Gizmo
Gizmo
CDCloudflare Developers
Created by Gizmo on 3/26/2024 in #workers-help
First time using workers (cron trigger), CANNOT get it to work for me.
Thanks for your help!
12 replies
CDCloudflare Developers
Created by Gizmo on 3/26/2024 in #workers-help
First time using workers (cron trigger), CANNOT get it to work for me.
Apparently it was in fact working, just not showing logs
12 replies
CDCloudflare Developers
Created by Gizmo on 3/26/2024 in #workers-help
First time using workers (cron trigger), CANNOT get it to work for me.
It deleted my message because I said a bad word. Thanks for the information, I’m just glad there’s a chance it’s not my fault lol
12 replies
CDCloudflare Developers
Created by Gizmo on 3/26/2024 in #workers-help
First time using workers (cron trigger), CANNOT get it to work for me.
export default {
// The scheduled handler is invoked at the interval set in our wrangler.toml's
// [[triggers]] configuration.
async scheduled(event, env, ctx) {
// A Cron Trigger can make requests to other endpoints on the Internet,
// publish to a Queue, query a D1 Database, and much more.
//
// We'll keep it simple and make an API call to a Cloudflare API:
let resp = await fetch('https://api.cloudflare.com/client/v4/ips');
let wasSuccessful = resp.ok ? 'success' : 'fail';

// You could store this result in KV, write to a D1 Database, or publish to a Queue.
// In this template, we'll just log the result:
console.log(`trigger fired at ${event.cron}: ${wasSuccessful}`);
},
};
export default {
// The scheduled handler is invoked at the interval set in our wrangler.toml's
// [[triggers]] configuration.
async scheduled(event, env, ctx) {
// A Cron Trigger can make requests to other endpoints on the Internet,
// publish to a Queue, query a D1 Database, and much more.
//
// We'll keep it simple and make an API call to a Cloudflare API:
let resp = await fetch('https://api.cloudflare.com/client/v4/ips');
let wasSuccessful = resp.ok ? 'success' : 'fail';

// You could store this result in KV, write to a D1 Database, or publish to a Queue.
// In this template, we'll just log the result:
console.log(`trigger fired at ${event.cron}: ${wasSuccessful}`);
},
};
Not sure if it's relevant, but I'm running the cron job template code
12 replies
CDCloudflare Developers
Created by Gizmo on 3/26/2024 in #workers-help
First time using workers (cron trigger), CANNOT get it to work for me.
No description
12 replies
CDCloudflare Developers
Created by Gizmo on 3/26/2024 in #workers-help
First time using workers (cron trigger), CANNOT get it to work for me.
No description
12 replies
CDCloudflare Developers
Created by Gizmo on 3/26/2024 in #workers-help
First time using workers (cron trigger), CANNOT get it to work for me.
No description
12 replies