Compare commits
5 Commits
v0.1.6
...
feature/sy
Author | SHA1 | Date | |
---|---|---|---|
ef187f8750 | |||
570b5abfa0 | |||
8f938f999e | |||
2249d1a776 | |||
37de21f06b |
@@ -17,7 +17,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
dotnet-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
|
||||
set-tag:
|
||||
name: Set Tag Name
|
||||
needs: [build-and-test]
|
||||
needs: [dotnet-build-and-test]
|
||||
#if: ${{ !failure() && !cancelled() && github.event_name != 'pull_request' }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
|
||||
docker-build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-and-test, set-tag]
|
||||
needs: [dotnet-build-and-test, set-tag]
|
||||
if: |
|
||||
needs.set-tag.outputs.should_tag == 'true' &&
|
||||
github.event_name != 'pull_request'
|
||||
|
@@ -36,6 +36,7 @@ builder.Services.AddHttpContextAccessor();
|
||||
|
||||
// Storage Singleton
|
||||
builder.Services.AddSingleton<IDashboardStore, DashboardStore>();
|
||||
builder.Services.AddSingleton<ISystemStore, SystemStore>();
|
||||
|
||||
// Background Services
|
||||
builder.Services.AddHostedService<NetworkCheck>();
|
||||
|
9
Watcher/Services/ISystemStore.cs
Normal file
9
Watcher/Services/ISystemStore.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Watcher.Services;
|
||||
|
||||
public interface ISystemStore
|
||||
{
|
||||
Boolean NewVersionAvailable { get; set; }
|
||||
|
||||
Double DatabaseSize { get; set; }
|
||||
|
||||
}
|
42
Watcher/Services/SystemMangement.cs
Normal file
42
Watcher/Services/SystemMangement.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
}
|
||||
}
|
9
Watcher/Services/SystemStore.cs
Normal file
9
Watcher/Services/SystemStore.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Watcher.Services;
|
||||
|
||||
public class SystemStore: ISystemStore
|
||||
{
|
||||
public Boolean NewVersionAvailable { get; set; }
|
||||
|
||||
public Double DatabaseSize { get; set; }
|
||||
|
||||
}
|
Reference in New Issue
Block a user