summaryrefslogtreecommitdiffstats
path: root/VegaData/Program.cs
diff options
context:
space:
mode:
authorivar <i@oiee.no>2025-10-19 15:21:01 +0200
committerivar <i@oiee.no>2025-10-19 15:21:01 +0200
commitb4b0a981ea5189ef03de593c02189781a91f4376 (patch)
tree7316b9eeb738e2bbeef227f4b89fb0135d7f0b46 /VegaData/Program.cs
parent3a09abdb7ff4c2ddee0dd764bd88258fa95f8b33 (diff)
downloadvegadata-b4b0a981ea5189ef03de593c02189781a91f4376.tar.xz
vegadata-b4b0a981ea5189ef03de593c02189781a91f4376.zip
.
Diffstat (limited to 'VegaData/Program.cs')
-rw-r--r--VegaData/Program.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/VegaData/Program.cs b/VegaData/Program.cs
index 3e483f4..76fd8e2 100644
--- a/VegaData/Program.cs
+++ b/VegaData/Program.cs
@@ -51,7 +51,7 @@ class Show
class DataWorker(IServiceScopeFactory serviceScopeFactory) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken) {
- const int interval = 1000 * 60 * 10;
+ const int interval = 1000 * 60 * 60;
while (!stoppingToken.IsCancellationRequested) {
try {
await Work(stoppingToken);
@@ -72,9 +72,9 @@ class DataWorker(IServiceScopeFactory serviceScopeFactory) : BackgroundService
var shows = await http.GetFromJsonAsync<ShowsResponse>("https://www.vegascene.no/api/program", ct);
var addedCount = 0;
if (refreshData) {
+ File.Copy("data/main.db", $"data/main-{Random.Shared.Next(10000)}.db");
db.Shows.RemoveRange(db.Shows);
await db.SaveChangesAsync(ct);
- File.Copy("data/main.db", $"data/main-{Random.Shared.Next(1000)}.db");
}
var count = await db.Shows.CountAsync(ct);