Files
SPT-Server-Build/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BackupConfig.cs
T
DrakiaXYZ 4e73778920 Fix multiple backups running at once
- Backups now have a cooldown, default of 30 seconds
- Backups now have a lock, in the event of a TOC/TOU race condition, the lock will stop duplicate backups
2025-10-26 10:17:26 -07:00

34 lines
880 B
C#

using System.Text.Json.Serialization;
namespace SPTarkov.Server.Core.Models.Spt.Config;
public record BackupConfig : BaseConfig
{
[JsonPropertyName("kind")]
public override string Kind { get; set; } = "spt-backup";
[JsonPropertyName("enabled")]
public required bool Enabled { get; set; }
[JsonPropertyName("maxBackups")]
public int MaxBackups { get; set; }
[JsonPropertyName("backupCooldown")]
public int BackupCooldown { get; set; }
[JsonPropertyName("directory")]
public string Directory { get; set; } = string.Empty;
[JsonPropertyName("backupInterval")]
public required BackupConfigInterval BackupInterval { get; set; }
}
public record BackupConfigInterval
{
[JsonPropertyName("enabled")]
public bool Enabled { get; set; }
[JsonPropertyName("intervalMinutes")]
public int IntervalMinutes { get; set; }
}