|
@@ -75,9 +75,9 @@ public class ConnectionLogdbService : IConnectionLogdbService
|
|
|
{
|
|
|
var log = new MachineLog(clientData, data, messageType, errorMsg, isSent);
|
|
|
//queueHandler.Enqueue(log);
|
|
|
- //WriteMachineLogEF(log);
|
|
|
+ _ = WriteMachineLogEF(log);
|
|
|
//insertConnectonLogHandler.HandleAsync(log);
|
|
|
- _ = InsertWithDapper(log);
|
|
|
+ //_ = InsertWithDapper(log);
|
|
|
}
|
|
|
|
|
|
private async Task InsertWithDapper(MachineLog log)
|
|
@@ -140,7 +140,7 @@ public class ConnectionLogdbService : IConnectionLogdbService
|
|
|
BundleInsertWithDapper,
|
|
|
//loggerFactory.CreateLogger("InsertMeterValueHandler")
|
|
|
logger,
|
|
|
- workerCnt: 1
|
|
|
+ workerCnt: 20
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -217,7 +217,7 @@ public class ConnectionLogdbService : IConnectionLogdbService
|
|
|
|
|
|
t1 = watch.ElapsedMilliseconds;
|
|
|
using SqlConnection sqlConnection = await sqlConnectionFactory.CreateAsync();
|
|
|
- using var tans = await sqlConnection.BeginTransactionAsync();
|
|
|
+ using var trans = await sqlConnection.BeginTransactionAsync();
|
|
|
|
|
|
t2 = watch.ElapsedMilliseconds;
|
|
|
var tableName = GetTableName(workTime);
|
|
@@ -239,11 +239,11 @@ public class ConnectionLogdbService : IConnectionLogdbService
|
|
|
parameters.Add("EVSEEndPoint", log.clientData.RemoteEndPoint == null ? "123" : log.clientData.RemoteEndPoint.ToString(), DbType.String, size: 25);
|
|
|
parameters.Add("Session", log.clientData.SessionID == null ? "123" : log.clientData.SessionID, DbType.String, size: 36);
|
|
|
|
|
|
- await sqlConnection.ExecuteAsync(command, parameters, tans);
|
|
|
+ await sqlConnection.ExecuteAsync(command, parameters, trans);
|
|
|
}
|
|
|
|
|
|
t3 = watch.ElapsedMilliseconds;
|
|
|
- await tans.CommitAsync();
|
|
|
+ await trans.CommitAsync();
|
|
|
|
|
|
watch.Stop();
|
|
|
t4 = watch.ElapsedMilliseconds;
|