mirror of
				https://github.com/nsnail/NetAdmin.git
				synced 2025-10-31 11:25:27 +08:00 
			
		
		
		
	style: 💄 code format (#174)
[skip ci] Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
		| @@ -18,12 +18,11 @@ public static class Numbers | ||||
|  | ||||
|     public const int MAX_LIMIT_BULK_REQ             = 100;   // 最大限制:批量请求数 | ||||
|     public const int MAX_LIMIT_EXPORT               = 10000; // 最大限制:导出为CSV文件的条数 | ||||
|     public const int MAX_LIMIT_PRINT_LEN_CONTENT    = 4096;  // 最大限制:打印长度(HTTP 内容) | ||||
|     public const int MAX_LIMIT_PRINT_LEN_SQL        = 4096;  // 最大限制:打印长度(SQL 语句) | ||||
|     public const int MAX_LIMIT_QUERY                = 1000;  // 最大限制:非分页查询条数 | ||||
|     public const int MAX_LIMIT_QUERY_PAGE_NO        = 10000; // 最大限制:分页查询页码 | ||||
|     public const int MAX_LIMIT_QUERY_PAGE_SIZE      = 100;   // 最大限制:分页查询页容量 | ||||
|     public const int MAX_LIMIT_RETRY_CNT_REDIS_LOCK = 10;    // 最大限制:Redis锁重试次数 | ||||
|     public const int REQUEST_LOG_BUFF_SIZE          = 10;    // 请求日志缓冲区大小 | ||||
|  | ||||
|     public const int SECS_CACHE_CHART            = 300; // 秒:缓存时间-仪表 | ||||
|     public const int SECS_CACHE_DEFAULT          = 60;  // 秒:缓存时间-默认 | ||||
|   | ||||
| @@ -1,11 +1,5 @@ | ||||
| #if !DEBUG | ||||
| using System.Collections.Concurrent; | ||||
| using NetAdmin.Domain.Dto.Sys.RequestLog; | ||||
|  | ||||
| #else | ||||
| using NetAdmin.SysComponent.Application.Services.Sys.Dependency; | ||||
| #endif | ||||
| using NetAdmin.Domain.Events.Sys; | ||||
| using NetAdmin.SysComponent.Application.Services.Sys.Dependency; | ||||
|  | ||||
| namespace NetAdmin.SysComponent.Host.Subscribers; | ||||
|  | ||||
| @@ -14,7 +8,7 @@ namespace NetAdmin.SysComponent.Host.Subscribers; | ||||
| /// </summary> | ||||
| public sealed class OperationLogger : IEventSubscriber | ||||
| { | ||||
|     #if !DEBUG | ||||
|     #if !DEBUG && DBTYPE_SQLSERVER | ||||
|     private static readonly ConcurrentQueue<CreateRequestLogReq> _requestLogs = new(); | ||||
|     #endif | ||||
|  | ||||
| @@ -28,7 +22,7 @@ public sealed class OperationLogger : IEventSubscriber | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         #if DEBUG | ||||
|         #if DEBUG || !DBTYPE_SQLSERVER | ||||
|         _ = await App.GetService<IRequestLogService>().CreateAsync(operationEvent.Data).ConfigureAwait(false); | ||||
|         #else | ||||
|         if (_requestLogs.Count > Numbers.REQUEST_LOG_BUFF_SIZE) { | ||||
| @@ -40,7 +34,7 @@ public sealed class OperationLogger : IEventSubscriber | ||||
|         #endif | ||||
|     } | ||||
|  | ||||
|     #if !DEBUG | ||||
|     #if !DEBUG && DBTYPE_SQLSERVER | ||||
|     private static async Task WriteToDbAsync() | ||||
|     { | ||||
|         var inserts = new List<CreateRequestLogReq>(Numbers.REQUEST_LOG_BUFF_SIZE); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 GitHub
						GitHub