fixes file-backed worker issue

This commit is contained in:
benbierens 2024-11-27 10:30:30 +01:00
parent f0cbc0a53a
commit 025c85c1aa
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
2 changed files with 4 additions and 6 deletions

View File

@ -13,14 +13,14 @@ namespace AutoClient.Modes.FolderStore
private readonly Action onNewPurchase;
private readonly CodexNode codex;
public FileWorker(App app, ICodexInstance instance, PurchaseInfo purchaseInfo, string folder, FileIndex filename, Action onFileUploaded, Action onNewPurchase)
: base(app, folder, filename + ".json", purchaseInfo)
public FileWorker(App app, ICodexInstance instance, PurchaseInfo purchaseInfo, string folder, FileIndex fileIndex, Action onFileUploaded, Action onNewPurchase)
: base(app, folder, fileIndex.File + ".json", purchaseInfo)
{
this.app = app;
log = new LogPrefixer(app.Log, GetFileTag(filename));
log = new LogPrefixer(app.Log, GetFileTag(fileIndex));
this.instance = instance;
this.purchaseInfo = purchaseInfo;
sourceFilename = filename.File;
sourceFilename = fileIndex.File;
if (sourceFilename.ToLowerInvariant().EndsWith(".json")) throw new Exception("Not an era file.");
this.onFileUploaded = onFileUploaded;
this.onNewPurchase = onNewPurchase;

View File

@ -12,8 +12,6 @@ namespace AutoClient.Modes.FolderStore
Folder = folder;
FilePath = filePath;
LoadState();
app.Log.Debug("Deserialized state: " + JsonConvert.SerializeObject(State));
}
private void LoadState()