From 9446b52e3da34b55e0a2181614a940be6703f84f Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 15 Sep 2021 18:54:43 -0600 Subject: [PATCH] Run jobs before delay --- app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt b/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt index d2647d9..d4cdfda 100644 --- a/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt +++ b/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt @@ -138,8 +138,8 @@ fun Application.moduleWithDependencies( RecurringTransactionProcessingJob(recurringTransactionRepository, transactionRepository) ) while (currentCoroutineContext().isActive) { - delay(Duration.hours(24)) jobs.forEach { it.run() } + delay(Duration.hours(24)) } } }