2023-01-24

This commit is contained in:
2023-01-24 09:06:42 -07:00
parent 281fa939be
commit a180f65069
10 changed files with 143 additions and 373 deletions

View File

@ -140,4 +140,6 @@ public class Description : IDescription, Properties.IDescription
return result;
}
internal static string GetDateFormat() => "MM/dd/yyyy hh:mm:ss tt";
}

View File

@ -296,6 +296,7 @@ public class FileRead : Properties.IFileRead
bool check;
long preWait;
string tupleFile;
string tupleFileName = string.Empty;
List<string> duplicateFiles = new();
StringBuilder stringBuilder = new();
List<int> consumedFileIndices = new();
@ -317,6 +318,7 @@ public class FileRead : Properties.IFileRead
tupleFile = string.Concat(duplicateDirectory, @"\", fileName, "_", scopeInfo.FileNameWithoutExtension, ".pdsfc");
else
tupleFile = GetTupleFile(logistics, descriptions, scopeInfo, duplicateDirectory);
tupleFileName = Path.GetFileNameWithoutExtension(tupleFile).Split('.')[0];
duplicateFiles.Add(tupleFile);
if (_IsEAFHosted)
File.WriteAllText(tupleFile, text);
@ -325,7 +327,7 @@ public class FileRead : Properties.IFileRead
{
if (DateTime.Now.Ticks > preWait)
break;
Thread.Sleep(500);
Thread.Sleep(100);
}
if (!moreThanAnHour)
{
@ -340,7 +342,17 @@ public class FileRead : Properties.IFileRead
for (int i = 0; i < duplicateFiles.Count; i++)
{
if (!File.Exists(duplicateFiles[i]))
consumedFileIndices.Add(i);
{
if (string.IsNullOrEmpty(tupleFileName))
consumedFileIndices.Add(i);
else if (duplicateFiles.All(l => Path.GetFileNameWithoutExtension(l).Split('.')[0] == tupleFileName))
{
for (int j = 0; j < duplicateFiles.Count; j++)
consumedFileIndices.Add(j);
}
else
consumedFileIndices.Add(i);
}
}
if (consumedFileIndices.Count == duplicateFiles.Count)
break;
@ -361,7 +373,7 @@ public class FileRead : Properties.IFileRead
}
throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder));
}
Thread.Sleep(500);
Thread.Sleep(250);
}
}
}

View File

@ -51,7 +51,7 @@ public class Logistics : ILogistics
_Logistics2 = new List<Logistics2>();
}
public Logistics(IFileRead fileRead, string reportFullPath, bool useSplitForMID, int? fileInfoLength = null)
public Logistics(IFileRead fileRead, long tickOffset, string reportFullPath, bool useSplitForMID, int? fileInfoLength = null)
{
if (string.IsNullOrEmpty(fileRead.CellInstanceName))
throw new Exception();
@ -59,7 +59,7 @@ public class Logistics : ILogistics
throw new Exception();
_NullData = fileRead.NullData;
_FileInfo = new(reportFullPath);
DateTime dateTime = _FileInfo.LastWriteTime;
DateTime dateTime = new(_FileInfo.LastWriteTime.Ticks + tickOffset);
if (fileInfoLength.HasValue && _FileInfo.Length < fileInfoLength.Value)
dateTime = dateTime.AddTicks(-1);
_JobID = fileRead.CellInstanceName;

View File

@ -16,7 +16,7 @@ public class ScopeInfo : Properties.IScopeInfo
public string QueryFilter { get; private set; }
public string FileNameWithoutExtension { get; private set; }
public ScopeInfo(Test test, string fileName, string queryFilter = "", string title = "", string html = "")
public ScopeInfo(Test test, string fileName, string queryFilter = "", string title = "", string html = "", string extraExtension = "")
{
Enum = test;
Test = test;