version 2 build
Build and Push Docker Image / build (push) Failing after 1s

This commit is contained in:
Jason Stedwell
2026-06-28 21:47:04 -05:00
parent 8498f7abc4
commit 14ce08c3c2
22 changed files with 462 additions and 116 deletions
+14
View File
@@ -0,0 +1,14 @@
/**
* Convert a polling interval in seconds into a cron expression.
* Pure and side-effect free so it can be unit-tested without touching the DB.
* - < 60s → every minute ("* * * * *")
* - < 60 minutes → every N minutes ("*\/15 * * * *")
* - otherwise → every N hours ("0 *\/6 * * *")
*/
export function secondsToCron(seconds: number): string {
if (seconds < 60) return '* * * * *'
const minutes = Math.round(seconds / 60)
if (minutes < 60) return `*/${minutes} * * * *`
const hours = Math.round(minutes / 60)
return `0 */${hours} * * *`
}