summaryrefslogtreecommitdiff
path: root/src/FundLab.Worker/Worker.fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/FundLab.Worker/Worker.fs')
-rw-r--r--src/FundLab.Worker/Worker.fs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/FundLab.Worker/Worker.fs b/src/FundLab.Worker/Worker.fs
new file mode 100644
index 0000000..6a7b7a7
--- /dev/null
+++ b/src/FundLab.Worker/Worker.fs
@@ -0,0 +1,15 @@
+namespace FundLab.Worker
+
+open System
+open System.Threading
+open System.Threading.Tasks
+open Microsoft.Extensions.Hosting
+
+type Worker() =
+ inherit BackgroundService()
+
+ override _.ExecuteAsync(stoppingToken: CancellationToken) : Task =
+ task {
+ while not stoppingToken.IsCancellationRequested do
+ do! Task.Delay(TimeSpan.FromMinutes 5, stoppingToken)
+ }