mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-07 16:03:07 +00:00
cleans up purchaseUTC when storage fails
This commit is contained in:
parent
a676e0463d
commit
c475802330
@ -165,8 +165,7 @@ namespace AutoClient.Modes.FolderStore
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
entry.EncodedCid = string.Empty;
|
||||
entry.PurchaseId = string.Empty;
|
||||
entry.ClearPurchase();
|
||||
saveChanges();
|
||||
log.Error("Failed to start new purchase: " + exc);
|
||||
HasFailed = true;
|
||||
@ -215,8 +214,7 @@ namespace AutoClient.Modes.FolderStore
|
||||
else if (!update.IsSubmitted)
|
||||
{
|
||||
Log("Request failed to start. State: " + update.State);
|
||||
entry.EncodedCid = string.Empty;
|
||||
entry.PurchaseId = string.Empty;
|
||||
entry.ClearPurchase();
|
||||
saveChanges();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -16,6 +16,13 @@
|
||||
public string EncodedCid { get; set; } = string.Empty;
|
||||
public string PurchaseId { get; set; } = string.Empty;
|
||||
public DateTime PurchaseFinishedUtc { get; set; } = DateTime.MinValue;
|
||||
|
||||
public void ClearPurchase()
|
||||
{
|
||||
EncodedCid = string.Empty;
|
||||
PurchaseId = string.Empty;
|
||||
PurchaseFinishedUtc = DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user