Bug Fix
This commit is contained in:
parent
6c8ad46064
commit
0a2f97fd93
21
EDA Viewer/.vscode/format-report.json
vendored
21
EDA Viewer/.vscode/format-report.json
vendored
@ -1,20 +1 @@
|
|||||||
[
|
[]
|
||||||
{
|
|
||||||
"DocumentId": {
|
|
||||||
"ProjectId": {
|
|
||||||
"Id": "1c39e10e-5359-42ab-be77-db59c291586c"
|
|
||||||
},
|
|
||||||
"Id": "81852d1e-25b8-4230-9e00-0399608db1e6"
|
|
||||||
},
|
|
||||||
"FileName": "Background.cshtml.cs",
|
|
||||||
"FilePath": "G:\\Mesa_FI\\EDA-Viewer\\EDA Viewer\\Pages\\Background.cshtml.cs",
|
|
||||||
"FileChanges": [
|
|
||||||
{
|
|
||||||
"LineNumber": 1,
|
|
||||||
"CharNumber": 1,
|
|
||||||
"DiagnosticId": "IMPORTS",
|
|
||||||
"FormatDescription": "Fix imports ordering."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
@ -112,7 +112,7 @@ public class TimedHostedService : IHostedService, IDisposable
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!_BackgroundMethods.IsPrimaryInstance())
|
if (_BackgroundMethods.IsPrimaryInstance())
|
||||||
_BackgroundMethods.LogPathCleanUpByWeekCallback();
|
_BackgroundMethods.LogPathCleanUpByWeekCallback();
|
||||||
}
|
}
|
||||||
catch (Exception e) { _Log.Error(e, "Error: "); }
|
catch (Exception e) { _Log.Error(e, "Error: "); }
|
||||||
@ -132,7 +132,7 @@ public class TimedHostedService : IHostedService, IDisposable
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!_BackgroundMethods.IsPrimaryInstance())
|
if (_BackgroundMethods.IsPrimaryInstance())
|
||||||
_BackgroundMethods.EDAOutputArchiveCallback();
|
_BackgroundMethods.EDAOutputArchiveCallback();
|
||||||
}
|
}
|
||||||
catch (Exception e) { _Log.Error(e, "Error: "); }
|
catch (Exception e) { _Log.Error(e, "Error: "); }
|
||||||
@ -152,7 +152,7 @@ public class TimedHostedService : IHostedService, IDisposable
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!_BackgroundMethods.IsPrimaryInstance())
|
if (_BackgroundMethods.IsPrimaryInstance())
|
||||||
_BackgroundMethods.EdaDataCollectionPlansCallback();
|
_BackgroundMethods.EdaDataCollectionPlansCallback();
|
||||||
}
|
}
|
||||||
catch (Exception e) { _Log.Error(e, "Error: "); }
|
catch (Exception e) { _Log.Error(e, "Error: "); }
|
||||||
|
@ -736,35 +736,10 @@ public class Background : Models.Properties.IBackground, IBackground, IDisposabl
|
|||||||
configuration = ParseXML<PDSFConfiguration>(xml, throwExceptions: true);
|
configuration = ParseXML<PDSFConfiguration>(xml, throwExceptions: true);
|
||||||
if (configuration is null)
|
if (configuration is null)
|
||||||
continue;
|
continue;
|
||||||
if (!Directory.Exists(Path.GetPathRoot(configuration.Settings.StoragePath)))
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
common.Update(configuration);
|
common.Update(configuration);
|
||||||
json = JsonSerializer.Serialize(configuration, configuration.GetType(), jsonSerializerOptions);
|
json = JsonSerializer.Serialize(configuration, configuration.GetType(), jsonSerializerOptions);
|
||||||
if (!Directory.Exists(common.StoragePath))
|
|
||||||
_ = Directory.CreateDirectory(common.StoragePath);
|
|
||||||
if (common?.UnitName is null)
|
if (common?.UnitName is null)
|
||||||
continue;
|
continue;
|
||||||
if (!common.StoragePath.Contains(common.UnitName) && (common.StoragePath.Contains(@"01EquipmentIntegration") || common.StoragePath.Contains(@"02BusinessIntegration")))
|
|
||||||
{
|
|
||||||
common.StoragePath = common.StoragePath.Replace("Traces", "Empty");
|
|
||||||
if (!Directory.Exists(common.StoragePath))
|
|
||||||
_ = Directory.CreateDirectory(common.StoragePath);
|
|
||||||
if (common.UnitName != "PRF01")
|
|
||||||
{
|
|
||||||
unitDirectory = string.Concat(Path.GetDirectoryName(common.StoragePath), @"\", common.UnitName);
|
|
||||||
common.StoragePath = string.Concat(unitDirectory, @"\BadPath");
|
|
||||||
if (!Directory.Exists(common.StoragePath))
|
|
||||||
_ = Directory.CreateDirectory(common.StoragePath);
|
|
||||||
common.StoragePath = string.Concat(unitDirectory, @"\LogFile");
|
|
||||||
if (!Directory.Exists(common.StoragePath))
|
|
||||||
_ = Directory.CreateDirectory(common.StoragePath);
|
|
||||||
common.StoragePath = string.Concat(unitDirectory, @"\PollPath");
|
|
||||||
if (!Directory.Exists(common.StoragePath))
|
|
||||||
_ = Directory.CreateDirectory(common.StoragePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileName = string.Concat(edaObjectFile.Replace(replace, "Partial"), ".csv");
|
fileName = string.Concat(edaObjectFile.Replace(replace, "Partial"), ".csv");
|
||||||
File.WriteAllText(fileName, common.ParametersAsCsv);
|
File.WriteAllText(fileName, common.ParametersAsCsv);
|
||||||
try
|
try
|
||||||
@ -816,6 +791,28 @@ public class Background : Models.Properties.IBackground, IBackground, IDisposabl
|
|||||||
{ File.SetCreationTime(fileName, lastModifiedDate); File.SetLastWriteTime(fileName, lastModifiedDate); }
|
{ File.SetCreationTime(fileName, lastModifiedDate); File.SetLastWriteTime(fileName, lastModifiedDate); }
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrEmpty(configuration.Settings.StoragePath) || !Directory.Exists(Path.GetPathRoot(configuration.Settings.StoragePath)))
|
||||||
|
continue;
|
||||||
|
if (!Directory.Exists(common.StoragePath))
|
||||||
|
_ = Directory.CreateDirectory(common.StoragePath);
|
||||||
|
if (!common.StoragePath.Contains(common.UnitName) && (common.StoragePath.Contains(@"01EquipmentIntegration") || common.StoragePath.Contains(@"02BusinessIntegration")))
|
||||||
|
{
|
||||||
|
common.StoragePath = common.StoragePath.Replace("Traces", "Empty");
|
||||||
|
if (!Directory.Exists(common.StoragePath))
|
||||||
|
_ = Directory.CreateDirectory(common.StoragePath);
|
||||||
|
if (common.UnitName != "PRF01")
|
||||||
|
{
|
||||||
|
unitDirectory = string.Concat(Path.GetDirectoryName(common.StoragePath), @"\", common.UnitName);
|
||||||
|
common.StoragePath = string.Concat(unitDirectory, @"\BadPath");
|
||||||
|
if (!Directory.Exists(common.StoragePath))
|
||||||
|
_ = Directory.CreateDirectory(common.StoragePath);
|
||||||
|
common.StoragePath = string.Concat(unitDirectory, @"\LogFile");
|
||||||
|
if (!Directory.Exists(common.StoragePath))
|
||||||
|
_ = Directory.CreateDirectory(common.StoragePath);
|
||||||
|
common.StoragePath = string.Concat(unitDirectory, @"\PollPath");
|
||||||
|
if (!Directory.Exists(common.StoragePath))
|
||||||
|
_ = Directory.CreateDirectory(common.StoragePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user