Compare commits
29 Commits
0.1.5
...
8417003ea7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8417003ea7 | ||
![]() |
8412cc13df | ||
![]() |
7dabcb71f8 | ||
![]() |
001711487c | ||
![]() |
bf4bcebfb8 | ||
![]() |
0561eb757c | ||
![]() |
5510832538 | ||
![]() |
604e8dfe70 | ||
![]() |
2c2a58975e | ||
![]() |
7572a66ae2 | ||
![]() |
3ed6c4c54f | ||
![]() |
f2472a3ea2 | ||
![]() |
4d657cf887 | ||
![]() |
1388ce80db | ||
![]() |
d335ddfd0d | ||
![]() |
68caf0a329 | ||
![]() |
2889661f24 | ||
![]() |
513589a6fc | ||
![]() |
28616252aa | ||
![]() |
09acbbefea | ||
![]() |
9598965a4a | ||
![]() |
2111eb21e3 | ||
![]() |
49ec368b2f | ||
![]() |
a473eccfda | ||
![]() |
ce82717d62 | ||
![]() |
3bb39ab17c | ||
![]() |
a66615c6fc | ||
![]() |
b054389b16 | ||
![]() |
71fb945de2 |
@@ -86,9 +86,9 @@ start() {
|
|||||||
echo "New version: $new_version"
|
echo "New version: $new_version"
|
||||||
|
|
||||||
gitchangelog | grep -v "[rR]elease:" > HISTORY.md
|
gitchangelog | grep -v "[rR]elease:" > HISTORY.md
|
||||||
git add song_of_the_day/VERSION
|
|
||||||
git add HISTORY.md
|
git add HISTORY.md
|
||||||
echo $new_version > song_of_the_day/VERSION
|
echo $new_version > song_of_the_day/VERSION
|
||||||
|
git add song_of_the_day/VERSION
|
||||||
git commit -m "release: version $new_version 🚀"
|
git commit -m "release: version $new_version 🚀"
|
||||||
echo "creating git tag : $new_version"
|
echo "creating git tag : $new_version"
|
||||||
git tag $new_version
|
git tag $new_version
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
name: Upload Python Package
|
name: Build Docker image
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
@@ -38,10 +38,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up dotnet
|
|
||||||
uses: actions/setup-dotnet@v4
|
|
||||||
with:
|
|
||||||
dotnet-version: '9.0.X'
|
|
||||||
- name: Check version match
|
- name: Check version match
|
||||||
run: |
|
run: |
|
||||||
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
|
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
|
||||||
@@ -61,5 +57,5 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')
|
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')
|
||||||
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
|
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
|
||||||
docker build -t "git.disi.dev/$REPOSITORY_OWNER/song-of-the-day:$(cat $REPOSITORY_NAME/VERSION)" ./song_of_the_day
|
docker build -t "git.disi.dev/$REPOSITORY_OWNER/song-of-the-day:$(cat $REPOSITORY_NAME/VERSION)" ./
|
||||||
docker push "git.disi.dev/$REPOSITORY_OWNER/song-of-the-day:$(cat $REPOSITORY_NAME/VERSION)"
|
docker push "git.disi.dev/$REPOSITORY_OWNER/song-of-the-day:$(cat $REPOSITORY_NAME/VERSION)"
|
||||||
|
6
CronTimer/CronEventArgs.cs
Normal file
6
CronTimer/CronEventArgs.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
public class CronTimerEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public DateTime At { get; set; }
|
||||||
|
}
|
78
CronTimer/CronTimer.cs
Normal file
78
CronTimer/CronTimer.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using NCrontab;
|
||||||
|
|
||||||
|
public class CronTimer
|
||||||
|
{
|
||||||
|
public const string UTC = "Etc/UTC";
|
||||||
|
|
||||||
|
static readonly TimeSpan InfiniteTimeSpan = TimeSpan.FromMilliseconds(Timeout.Infinite); // net 3.5
|
||||||
|
|
||||||
|
readonly CrontabSchedule schedule;
|
||||||
|
readonly TimeZoneInfo tzi;
|
||||||
|
readonly string id;
|
||||||
|
readonly Timer t;
|
||||||
|
|
||||||
|
public string tz { get; }
|
||||||
|
public string Expression { get; }
|
||||||
|
public event EventHandler<CronTimerEventArgs> OnOccurence;
|
||||||
|
|
||||||
|
public DateTime Next { get; private set; }
|
||||||
|
|
||||||
|
public CronTimer(string expression, string tz = UTC, bool includingSeconds = false)
|
||||||
|
{
|
||||||
|
Expression = expression;
|
||||||
|
this.tz = tz;
|
||||||
|
id = TimeZoneConverter.TZConvert.IanaToWindows(tz);
|
||||||
|
tzi = TimeZoneInfo.FindSystemTimeZoneById(id);
|
||||||
|
schedule = CrontabSchedule.Parse(expression, new CrontabSchedule.ParseOptions { IncludingSeconds = includingSeconds });
|
||||||
|
Next = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, tzi);
|
||||||
|
OnOccurence += OnOccurenceScheduleNext;
|
||||||
|
t = new Timer(s =>
|
||||||
|
{
|
||||||
|
var ea = new CronTimerEventArgs
|
||||||
|
{
|
||||||
|
At = Next
|
||||||
|
};
|
||||||
|
OnOccurence(this, ea);
|
||||||
|
}, null, InfiniteTimeSpan, InfiniteTimeSpan);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnOccurenceScheduleNext(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var delay = CalculateDelay();
|
||||||
|
//Console.WriteLine($"Next for [{tz} {expression}] in {delay}.");
|
||||||
|
t.Change(delay, InfiniteTimeSpan);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
var delay = CalculateDelay();
|
||||||
|
//Console.WriteLine($"Next for [{tz} {expression}] in {delay}.");
|
||||||
|
t.Change(delay, InfiniteTimeSpan);
|
||||||
|
}
|
||||||
|
|
||||||
|
TimeSpan CalculateDelay()
|
||||||
|
{
|
||||||
|
var nowUtc = DateTime.UtcNow;
|
||||||
|
Next = schedule.GetNextOccurrence(Next);
|
||||||
|
TimeSpan delay;
|
||||||
|
if (tz != UTC)
|
||||||
|
{
|
||||||
|
var nextUtc = TimeZoneInfo.ConvertTimeToUtc(Next, tzi);
|
||||||
|
delay = nextUtc - nowUtc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delay = Next - nowUtc;
|
||||||
|
}
|
||||||
|
//Console.WriteLine($"Now: {nowUtc} [utc] {now} [{tz}], Next: {next} [{tz}] {nextUtc} [utc], Delay: {delay}");
|
||||||
|
if (delay < TimeSpan.Zero) delay = TimeSpan.Zero;
|
||||||
|
return delay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
t.Change(InfiniteTimeSpan, InfiniteTimeSpan);
|
||||||
|
}
|
||||||
|
}
|
49
CronTimer/CronTimer.csproj
Normal file
49
CronTimer/CronTimer.csproj
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<TargetFrameworks>net461;netstandard2.1</TargetFrameworks>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- AssemblyFileVersionAttribute -->
|
||||||
|
<FileVersion>2.0.1</FileVersion>
|
||||||
|
<!-- AssemblyInformationalVersionAttribute -->
|
||||||
|
<Version>$(FileVersion)</Version>
|
||||||
|
<!-- AssemblyVersionAttribute -->
|
||||||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||||
|
<!-- Nuget -->
|
||||||
|
<PackageVersion>$(Version)</PackageVersion>
|
||||||
|
<PackageId>CronTimer</PackageId>
|
||||||
|
<Company>https://github.com/ramonsmits</Company>
|
||||||
|
<Authors>ramonsmits</Authors>
|
||||||
|
<Description>Simple .net Timer that is based on cron expressions with second accuracy to fire timer events to a very specific schedule.</Description>
|
||||||
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||||
|
<PackageReleaseNotes></PackageReleaseNotes>
|
||||||
|
<PackageProjectUrl>https://github.com/ramonsmits/CronTimer/tree/$(PackageVersion)</PackageProjectUrl>
|
||||||
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
|
<IncludeSymbols>True</IncludeSymbols>
|
||||||
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
|
<IncludeSource>True</IncludeSource>
|
||||||
|
<RepositoryUrl>https://github.com/ramonsmits/CronTimer</RepositoryUrl>
|
||||||
|
<Copyright>Copyright 2022 (c) Ramon Smits</Copyright>
|
||||||
|
<PackageTags>cron timer</PackageTags>
|
||||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="ncrontab" Version="3.3.1" />
|
||||||
|
<PackageReference Include="TimeZoneConverter" Version="6.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!--<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions">
|
||||||
|
<Version>3.1.4</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>-->
|
||||||
|
|
||||||
|
</Project>
|
36
CronTimer/CronTimer.sln
Normal file
36
CronTimer/CronTimer.sln
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.30717.126
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CronTimer", "CronTimer.csproj", "{FB64C227-8615-4AE1-94E3-F9F9DF192B72}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CCDD0B34-653C-430C-9B17-5129618F8D7D}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
..\README.md = ..\README.md
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "..\Demo\Demo.csproj", "{C2638357-1621-4422-8701-B55BFB37ACCF}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C2638357-1621-4422-8701-B55BFB37ACCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C2638357-1621-4422-8701-B55BFB37ACCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C2638357-1621-4422-8701-B55BFB37ACCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C2638357-1621-4422-8701-B55BFB37ACCF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {A639B164-6581-40DF-ADC4-479DAB467CFE}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
@@ -4,9 +4,9 @@ WORKDIR /App
|
|||||||
# Copy everything
|
# Copy everything
|
||||||
COPY . ./
|
COPY . ./
|
||||||
# Restore as distinct layers
|
# Restore as distinct layers
|
||||||
RUN dotnet restore
|
RUN dotnet restore ./song_of_the_day/song_of_the_day.csproj
|
||||||
# Build and publish a release
|
# Build and publish a release
|
||||||
RUN dotnet publish -o out
|
RUN dotnet publish ./song_of_the_day/song_of_the_day.csproj -o out
|
||||||
|
|
||||||
# Build runtime image
|
# Build runtime image
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
168
HISTORY.md
168
HISTORY.md
@@ -5,10 +5,178 @@ Changelog
|
|||||||
(unreleased)
|
(unreleased)
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Remove unnecessary dotnet runtime download in CI job refs NOISSUE.
|
||||||
|
[Simon Diesenreiter]
|
||||||
|
|
||||||
|
|
||||||
|
0.1.19 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Improve Docker build refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.18 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Remove broken Crontimer NuGet feed reference refs NOISSUE. [Simon
|
||||||
|
Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.17 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Remove uinnecessary NuGet login refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.16 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Add direct CronTimer reference refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.15 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Login to NuGet feed at build refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.14 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Fix typo refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.13 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Really fix Crontab dependency refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.12 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Hotfixed CronTab dependencyrefs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.11 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- More debug outputs refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.10 (2025-04-15)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Release version jumbled up refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.9 (2025-04-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
|
||||||
|
0.1.8 (2025-04-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Additional debug outputs refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.7 (2025-04-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- More fixes in release logic refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.6 (2025-04-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Makefile issues on sh refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.1.5 (2025-04-14)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Messed up release refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
|
||||||
|
0.1.4 (2025-04-14)
|
||||||
|
------------------
|
||||||
|
|
||||||
Fix
|
Fix
|
||||||
~~~
|
~~~
|
||||||
- Repo casing refs NOISSUE. [Simon Diesenreiter]
|
- Repo casing refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
0.1.3 (2025-04-14)
|
0.1.3 (2025-04-14)
|
||||||
------------------
|
------------------
|
||||||
|
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
.PHONY: issetup
|
.PHONY: issetup
|
||||||
issetup:
|
issetup:
|
||||||
@[ -f .git/hooks/commit-msg ] || [ -v SKIP_MAKE_SETUP_CHECK ] || (echo "You must run 'make setup' first to initialize the repo!" && exit 1)
|
@[ -f .git/hooks/commit-msg ] || [ $SKIP_MAKE_SETUP_CHECK = "true" ] || (echo "You must run 'make setup' first to initialize the repo!" && exit 1)
|
||||||
|
|
||||||
.PHONY: setup
|
.PHONY: setup
|
||||||
setup:
|
setup:
|
||||||
|
10
nuget.config
10
nuget.config
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||||
<clear />
|
<clear />
|
||||||
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
|
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
|
||||||
<!--add key="gitea-projects" value="https://git.disi.dev/api/packages/Projects/nuget/index.json" />
|
<!--add key="gitea-projects" value="https://git.disi.dev/api/packages/Projects/nuget/index.json" /-->
|
||||||
<add key="gitea-homelab" value="https://git.disi.dev/api/packages/Homelab/nuget/index.json" />
|
<!--add key="gitea-artifacts" value="https://git.disi.dev/api/packages/Artifacts/nuget/index.json" /-->
|
||||||
<add key="gitea-artifacts" value="https://git.disi.dev/api/packages/Artifacts/nuget/index.json" /-->
|
<add key="HomeLab" value="https://git.disi.dev/api/packages/HomeLab/nuget/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
@@ -9,6 +9,7 @@ SignalIntegration.Instance = new SignalIntegration(AppConfiguration.Instance.Sig
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
Console.WriteLine("Setting up user check timer");
|
||||||
var userCheckTimer = new CronTimer("*/1 * * * *", "Europe/Vienna", includingSeconds: false);
|
var userCheckTimer = new CronTimer("*/1 * * * *", "Europe/Vienna", includingSeconds: false);
|
||||||
userCheckTimer.OnOccurence += async (s, ea) =>
|
userCheckTimer.OnOccurence += async (s, ea) =>
|
||||||
{
|
{
|
||||||
@@ -17,6 +18,7 @@ userCheckTimer.OnOccurence += async (s, ea) =>
|
|||||||
var needsSaving = false;
|
var needsSaving = false;
|
||||||
foreach (var memberId in memberList)
|
foreach (var memberId in memberList)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("found member: " + memberId);
|
||||||
var foundUser = dci.Users.Where(u => u.SignalMemberId == memberId).SingleOrDefault();
|
var foundUser = dci.Users.Where(u => u.SignalMemberId == memberId).SingleOrDefault();
|
||||||
if (foundUser == null)
|
if (foundUser == null)
|
||||||
{
|
{
|
||||||
@@ -43,6 +45,7 @@ userCheckTimer.OnOccurence += async (s, ea) =>
|
|||||||
};
|
};
|
||||||
userCheckTimer.Start();
|
userCheckTimer.Start();
|
||||||
|
|
||||||
|
Console.WriteLine("Setting up user intro timer");
|
||||||
var userIntroTimer = new CronTimer("*/1 * * * *", "Europe/Vienna", includingSeconds: false);
|
var userIntroTimer = new CronTimer("*/1 * * * *", "Europe/Vienna", includingSeconds: false);
|
||||||
userIntroTimer.OnOccurence += async (s, ea) =>
|
userIntroTimer.OnOccurence += async (s, ea) =>
|
||||||
{
|
{
|
||||||
@@ -64,6 +67,8 @@ userIntroTimer.OnOccurence += async (s, ea) =>
|
|||||||
};
|
};
|
||||||
userIntroTimer.Start();
|
userIntroTimer.Start();
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine("Setting up pick of the day timer");
|
||||||
var pickOfTheDayTimer = new CronTimer("0 8 * * *", "Europe/Vienna", includingSeconds: false);
|
var pickOfTheDayTimer = new CronTimer("0 8 * * *", "Europe/Vienna", includingSeconds: false);
|
||||||
pickOfTheDayTimer.OnOccurence += async (s, ea) =>
|
pickOfTheDayTimer.OnOccurence += async (s, ea) =>
|
||||||
{
|
{
|
||||||
|
@@ -1 +1 @@
|
|||||||
0.1.4
|
0.1.20
|
||||||
|
@@ -16,9 +16,11 @@
|
|||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
||||||
<PackageReference Include="NSwag.ApiDescription.Client" Version="13.0.5" />
|
<PackageReference Include="NSwag.ApiDescription.Client" Version="13.0.5" />
|
||||||
<PackageReference Include="Scalar.AspNetCore" Version="2.1.*" />
|
<PackageReference Include="Scalar.AspNetCore" Version="2.1.*" />
|
||||||
<PackageReference Include="CronTimer" Version="2.0.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<OpenApiReference Include="swagger.json" SourceUrl="https://bbernhard.github.io/signal-cli-rest-api/src/docs/swagger.json" />
|
<OpenApiReference Include="swagger.json" SourceUrl="https://bbernhard.github.io/signal-cli-rest-api/src/docs/swagger.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\CronTimer\CronTimer.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Reference in New Issue
Block a user