Skip to content

Commit

Permalink
Trying to avoid invalid cron string [code: 10100]
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarscher committed Feb 1, 2024
1 parent 856b353 commit e127215
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/scheduled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const scheduled: ExportedHandlerScheduledHandler<Bindings> = async (event, env,
console.log('Running cron', event.cron)
const ctx = await createContext(env)
await match({ event, ctx })
.with({ event: { cron: '15 2 * * 0' } }, async ({ ctx }) => {
.with({ event: { cron: '15 2 * * sat' } }, async ({ ctx }) => {
await ctx.auth.deleteExpiredSessions()
console.log('Deleted expired sessions')
})
Expand Down
6 changes: 3 additions & 3 deletions packages/api/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ migrations_dir = "migrations"
# - At 3PM on first day of the month
# - At 11:59PM on the last weekday of the month
# crons = [ "*/3 * * * *", "0 15 1 * *", "59 23 LW * *" ]
# For now, we're using "15 2 * * 0" to delete expired sessions from the database weekly
# Test locally with "http://localhost:8787/__scheduled?cron=15+2+*+*+0"
crons = [ "15 2 * * 0" ]
# For now, we're using "15 2 * * sat" to delete expired sessions from the database weekly
# Test locally with "http://localhost:8787/__scheduled?cron=15+2+*+*+sat"
crons = [ "15 2 * * sat" ]


# The necessary secrets are:
Expand Down

0 comments on commit e127215

Please sign in to comment.