42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using System.Net.Http;
|
|
|
|
namespace Watcher.Services;
|
|
|
|
public class SystemManagement : BackgroundService
|
|
{
|
|
private readonly ILogger<NetworkCheck> _logger;
|
|
|
|
private ISystemStore _SystemStore;
|
|
|
|
public SystemManagement(ILogger<NetworkCheck> logger, ISystemStore SystemStore)
|
|
{
|
|
_logger = logger;
|
|
_SystemStore = SystemStore;
|
|
|
|
}
|
|
|
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
{
|
|
// Todo: Umstellen auf einmal alle 24h
|
|
var timer = new PeriodicTimer(TimeSpan.FromSeconds(30));
|
|
|
|
while (await timer.WaitForNextTickAsync(stoppingToken))
|
|
{
|
|
// Hintergrundprozess abwarten
|
|
await checkForNewDockerImageVersion();
|
|
|
|
// 5 Sekdunden Offset
|
|
await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken);
|
|
}
|
|
}
|
|
|
|
public Task checkForNewDockerImageVersion()
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task createDailySqliteBackup()
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
} |