|
@@ -3,6 +3,7 @@ using EVCB_OCPP.Domain;
|
|
|
using EVCB_OCPP.Domain.ConnectionFactory;
|
|
|
using EVCB_OCPP.Domain.Models.MainDb;
|
|
|
using EVCB_OCPP.WSServer.Helper;
|
|
|
+using EVCB_OCPP.WSServer.Message;
|
|
|
using Microsoft.AspNetCore.Connections;
|
|
|
using Microsoft.Data.SqlClient;
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
@@ -49,6 +50,7 @@ public interface IMainDbService
|
|
|
Task AddMachineConfiguration(string chargeBoxId, string key, string value, bool isReadOnly, bool isExist = true);
|
|
|
Task UpdateMachineConfiguration(string chargeBoxId, string item, string empty, bool v, bool isExists = true);
|
|
|
Task<List<MachineConfigurations>> GetMachineConfiguration(string chargeBoxId);
|
|
|
+ Task<MessageResult> TryGetResponseFromDb(string msgId);
|
|
|
}
|
|
|
|
|
|
public class MainDbService : IMainDbService
|
|
@@ -477,7 +479,7 @@ public class MainDbService : IMainDbService
|
|
|
updateMachineBasicInfoHandler = new GroupHandler<UpdateMachineBasicInfoParam>(
|
|
|
handleFunc: BundelUpdateMachineBasicInfo,
|
|
|
logger: loggerFactory.CreateLogger("UpdateMachineBasicInfoHandler"),
|
|
|
- workerCnt: 10);
|
|
|
+ workerCnt: 1);
|
|
|
}
|
|
|
|
|
|
private void InitUpdateServerMessageUpdateOnHandler()
|
|
@@ -505,7 +507,7 @@ public class MainDbService : IMainDbService
|
|
|
logger: loggerFactory.CreateLogger("GetMachineConfigurationHandler"),
|
|
|
workerCnt: 10);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
private async Task UpdateMachineBasicInfoEF(string chargeBoxId, Machine machine)
|
|
|
{
|
|
@@ -1125,7 +1127,7 @@ public class MainDbService : IMainDbService
|
|
|
return machine.ConnectorType;
|
|
|
}
|
|
|
|
|
|
- public async Task SetMachineConnectionType(string chargeBoxId,int v, CancellationToken token = default)
|
|
|
+ public async Task SetMachineConnectionType(string chargeBoxId, int v, CancellationToken token = default)
|
|
|
{
|
|
|
using var db = await contextFactory.CreateDbContextAsync(token);
|
|
|
|