diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-03-15 11:02:41 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-03-15 11:02:41 -0500 |
| commit | 01fa711484e120f91d7d21e0957f98c0842551ad (patch) | |
| tree | 45d5ac0737b9ef1301131e06c728f90380d0f465 /src | |
| parent | 6751f5bb1a34d030e6ce5078b20e57b6ea0053a5 (diff) | |
| download | slskd-01fa711484e120f91d7d21e0957f98c0842551ad.tar.gz | |
add NextAttemptAt
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs | 8 | ||||
| -rw-r--r-- | src/slskd/Transfers/Types/Transfer.cs | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs index 66083a83..5965f7b7 100644 --- a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs @@ -46,6 +46,7 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration // check to see if the Attempts and BatchId columns exist if (columns.Any(c => c.Name == nameof(Transfer.Attempts)) + && columns.Any(c => c.Name == nameof(Transfer.NextAttemptAt)) && columns.Any(c => c.Name == nameof(Transfer.BatchId)) && indexes.Any(i => i.Name.Equals("IDX_Transfers_BatchId", StringComparison.OrdinalIgnoreCase))) { @@ -78,7 +79,7 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration command.ExecuteNonQuery(); } - Log.Information("> Adding BatchId and Attempts columns to the Transfers table..."); + Log.Information("> Adding BatchId, Attempts, and NextAttemptAt columns to the Transfers table..."); if (!columns.Any(c => c.Name == nameof(Transfer.BatchId))) { @@ -90,6 +91,11 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration Exec("ALTER TABLE Transfers ADD COLUMN Attempts INTEGER NOT NULL DEFAULT 0;"); } + if (!columns.Any(c => c.Name == nameof(Transfer.NextAttemptAt))) + { + Exec("ALTER TABLE Transfers ADD COLUMN NextAttemptAt TEXT NULL;"); + } + Log.Information("> New columns added"); Log.Information("> Adding missing index(es) on the Transfers table..."); diff --git a/src/slskd/Transfers/Types/Transfer.cs b/src/slskd/Transfers/Types/Transfer.cs index 56f6b333..7facb3ee 100644 --- a/src/slskd/Transfers/Types/Transfer.cs +++ b/src/slskd/Transfers/Types/Transfer.cs @@ -69,6 +69,8 @@ namespace slskd.Transfers public int Attempts { get; set; } = 0; + public DateTime? NextAttemptAt { get; set; } = null; + [JsonIgnore] public bool Removed { get; set; } |
