Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Ziaei committed Mar 30, 2024
1 parent 2d29dcc commit 006acff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/scheduler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export interface Env {

export default {
async scheduled(event: ScheduledEvent, env: Env): Promise<void> {
const response = await fetch(`${env.BASE_URL}/jokes`, {
const resp = await fetch(`${env.BASE_URL}/jokes`, {
method: 'POST',
headers: { Authorization: env.API_TOKEN },
})
const wasSuccessful = response.ok ? 'success' : 'fail'
const wasSuccessful = resp.ok ? 'success' : 'fail'
console.log(`trigger fired at ${event.cron}: ${wasSuccessful}`)
},
}

0 comments on commit 006acff

Please sign in to comment.