修改多时区问题解决
This commit is contained in:
@@ -136,16 +136,23 @@ namespace IRaCIS.Application.Services.BackGroundJob
|
||||
throw new BusinessValidationFailedException(StaticData.International("IRaCISCHangfireJob_FileNotFound"));
|
||||
}
|
||||
|
||||
FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath));
|
||||
var watcher = new FileSystemWatcher
|
||||
{
|
||||
Path = Path.GetDirectoryName(filePath)!,
|
||||
NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size|NotifyFilters.LastAccess,
|
||||
Filter = Path.GetFileName(filePath),
|
||||
EnableRaisingEvents = true,
|
||||
|
||||
};
|
||||
|
||||
watcher.Changed += (sender, e) => LoadJsonFile(filePath);
|
||||
watcher.EnableRaisingEvents = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void LoadJsonFile(string filePath)
|
||||
{
|
||||
|
||||
Console.WriteLine("刷新json内存数据");
|
||||
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile(filePath,false,true);
|
||||
|
||||
IConfigurationRoot enConfiguration = builder.Build();
|
||||
|
||||
@@ -45,8 +45,6 @@ namespace IRaCIS.Application.Services
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
Subject? mapedSubject = null;
|
||||
|
||||
if (subjectCommand.Id == null) //insert
|
||||
@@ -64,8 +62,6 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
await _subjectRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(mapedSubject.Id.ToString());
|
||||
|
||||
Reference in New Issue
Block a user