Отформатировать списки параметров по код-стайлу
Больше двух параметров — каждый на отдельной строке (закрывающая скобка в конце последнего); два и меньше — в одну строку. Правило добавлено в docs/spec/Код-стайл-Дейл.md; применено к 628 сигнатурам в 253 файлах.
This commit is contained in:
@@ -70,7 +70,10 @@ public sealed class HttpAccessLogMiddleware
|
||||
// context: Контекст запроса (метод/путь/статус ответа).
|
||||
// startedAt: Метка времени старта запроса (Stopwatch.GetTimestamp).
|
||||
// exception: Необработанное исключение (null — запрос завершился штатно).
|
||||
private void LogCall(HttpContext context, long startedAt, Exception? exception)
|
||||
private void LogCall(
|
||||
HttpContext context,
|
||||
long startedAt,
|
||||
Exception? exception)
|
||||
{
|
||||
long elapsedMs = (long)Stopwatch.GetElapsedTime(startedAt).TotalMilliseconds;
|
||||
string method = context.Request.Method;
|
||||
|
||||
@@ -30,9 +30,7 @@ public sealed class OperatorSessionMiddleware
|
||||
private readonly RequestDelegate _next;
|
||||
private readonly IOptionsMonitor<OperatorCookieOptions> _cookieOptions;
|
||||
|
||||
public OperatorSessionMiddleware(
|
||||
RequestDelegate next,
|
||||
IOptionsMonitor<OperatorCookieOptions> cookieOptions)
|
||||
public OperatorSessionMiddleware(RequestDelegate next, IOptionsMonitor<OperatorCookieOptions> cookieOptions)
|
||||
{
|
||||
_next = next;
|
||||
_cookieOptions = cookieOptions;
|
||||
|
||||
@@ -102,7 +102,10 @@ public static class RateLimitPolicies
|
||||
// scope: Пространство ключей (имя политики или "global" для глобального лимитера).
|
||||
// permitsPerMinute: Разрешено запросов в минуту на партицию (RateLimit:ApiPerMinute).
|
||||
// Возвращает: Партиция лимитера с ключом tenant:{id} либо IP.
|
||||
private static RateLimitPartition<string> ApiPartition(HttpContext context, string scope, int permitsPerMinute)
|
||||
private static RateLimitPartition<string> ApiPartition(
|
||||
HttpContext context,
|
||||
string scope,
|
||||
int permitsPerMinute)
|
||||
{
|
||||
string partitionKey = context.GetCurrentUser() is { } user
|
||||
? TenantKeyPrefix + user.TenantId.ToString("N")
|
||||
@@ -117,7 +120,10 @@ public static class RateLimitPolicies
|
||||
// permitsPerMinute: Разрешено запросов в минуту.
|
||||
// Возвращает: Партиция store-backed лимитера (ленивое создание и кеш — менеджер партиций).
|
||||
private static RateLimitPartition<string> StorePartition(
|
||||
HttpContext context, string scope, string partitionKey, int permitsPerMinute)
|
||||
HttpContext context,
|
||||
string scope,
|
||||
string partitionKey,
|
||||
int permitsPerMinute)
|
||||
{
|
||||
string storeKey = HttpKeyPrefix + scope + ":" + partitionKey;
|
||||
return RateLimitPartition.Get(storeKey, key => new StoreBackedFixedWindowRateLimiter(
|
||||
|
||||
Reference in New Issue
Block a user