Bug Fix
This commit is contained in:
parent
2301a9a9ee
commit
7ab4b756d1
@ -205,7 +205,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
long tick = DateTime.Now.Ticks;
|
||||
string ids = GetIds(httpClient, basePage, api, query);
|
||||
DownloadWorkItemsAsync(httpClient, basePage, api, targetFileLocation, ids, tick);
|
||||
if (!string.IsNullOrEmpty(ids))
|
||||
DownloadWorkItemsAsync(httpClient, basePage, api, targetFileLocation, ids, tick);
|
||||
}
|
||||
|
||||
private void Callback(object state)
|
||||
|
@ -110,14 +110,12 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
|
||||
private static void ParseWorkItemsAsync(FileConnectorConfiguration fileConnectorConfiguration, string[] alternateTargetFolders, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
bool writeFile;
|
||||
string checkFile;
|
||||
string? pathRoot;
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { WriteIndented = true };
|
||||
string json = JsonSerializer.Serialize(workItems, jsonSerializerOptions);
|
||||
foreach (string alternateTargetFolder in alternateTargetFolders)
|
||||
{
|
||||
writeFile = true;
|
||||
if (alternateTargetFolder == fileConnectorConfiguration.TargetFileLocation)
|
||||
continue;
|
||||
pathRoot = Path.GetPathRoot(alternateTargetFolder);
|
||||
@ -135,10 +133,9 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
string old = File.ReadAllText(checkFile);
|
||||
if (old == json)
|
||||
writeFile = false;
|
||||
continue;
|
||||
}
|
||||
if (writeFile)
|
||||
File.WriteAllText(checkFile, json);
|
||||
File.WriteAllText(checkFile, json);
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,10 +256,9 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
string old = File.ReadAllText(checkFile);
|
||||
if (json == old)
|
||||
{
|
||||
moveFile = false;
|
||||
File.Delete(reportFullPath);
|
||||
}
|
||||
else
|
||||
File.Delete(checkFile);
|
||||
}
|
||||
if (moveFile)
|
||||
File.Move(reportFullPath, checkFile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user