diff --git a/AgileConfig.Server.Apisite/Websocket/WebsocketHandlerMiddleware.cs b/AgileConfig.Server.Apisite/Websocket/WebsocketHandlerMiddleware.cs index 8a22f7f5..ff6cccd5 100644 --- a/AgileConfig.Server.Apisite/Websocket/WebsocketHandlerMiddleware.cs +++ b/AgileConfig.Server.Apisite/Websocket/WebsocketHandlerMiddleware.cs @@ -100,7 +100,7 @@ public async Task Invoke( { await Handle(context, client, configService, registerCenterService, serviceInfoService); } - catch (WebSocketException ex) + catch (WebSocketException) { _logger.LogInformation("client {0} closed the websocket connection directly .", client.Id); await _websocketCollection.RemoveClient(client, WebSocketCloseStatus.Empty, null); diff --git a/AgileConfig.Server.Service/SysLogService.cs b/AgileConfig.Server.Service/SysLogService.cs index 1c80a29a..f2b7b1ae 100644 --- a/AgileConfig.Server.Service/SysLogService.cs +++ b/AgileConfig.Server.Service/SysLogService.cs @@ -21,15 +21,13 @@ public SysLogService(FreeSqlContext context) public async Task AddRangeAsync(IEnumerable logs) { - await _dbContext.SysLogs.AddRangeAsync(logs); - int x = await _dbContext.SaveChangesAsync(); + int x = await _dbContext.Freesql.Insert(logs).ExecuteAffrowsAsync(); return x > 0; } public async Task AddSysLogAsync(SysLog log) { - await _dbContext.SysLogs.AddAsync(log); - int x = await _dbContext.SaveChangesAsync(); + int x = await _dbContext.Freesql.Insert(log).ExecuteAffrowsAsync();; return x > 0; }