Skip to content

Commit

Permalink
Merge pull request #1128 from hackclub/bring-back-background-job
Browse files Browse the repository at this point in the history
Bring back accidentally deleted file
  • Loading branch information
maxwofford authored Jan 23, 2025
2 parents 60bb40e + 8c726f2 commit 2113963
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/api/cron/create-background-job.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { sql } from '@vercel/postgres'

export default async function createBackgroundJob(
type: 'run_lottery' | 'create_person' | 'invite',
args: {},
status: 'pending' | 'completed' | 'failed' = 'pending',
) {
console.log(JSON.stringify(args))
return await sql`INSERT INTO background_job (type, args, status) VALUES (${type}, ${JSON.stringify(args)}, ${status})`
}

export const fetchCache = 'force-no-store'

0 comments on commit 2113963

Please sign in to comment.