Skip to content

Commit

Permalink
修复 sys_log 表自增 id 在某些版本数据库上新增有问题的 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kklldog committed May 23, 2022
1 parent f654d57 commit ed9ec70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions AgileConfig.Server.Service/SysLogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ public SysLogService(FreeSqlContext context)

public async Task<bool> AddRangeAsync(IEnumerable<SysLog> 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<bool> AddSysLogAsync(SysLog log)
{
await _dbContext.SysLogs.AddAsync(log);
int x = await _dbContext.SaveChangesAsync();
int x = await _dbContext.Freesql.Insert(log).ExecuteAffrowsAsync();;
return x > 0;
}

Expand Down

0 comments on commit ed9ec70

Please sign in to comment.