I want the scheduler to retry in case of failure but not to reschedule after a successful execution. I created the scheduler (15/01/2024 11.30 AM) using below code, I can able to successfully create the scheduler, but the problem is its automatically rescheduling it (15/01/2025 11.30 AM) next year,
Are there any automated settings available after the scheduler is success, delete the scheduler automatically (Note: write now I'm manually deleting the scheduler daily cron based)
const retryDuration = root.lookupType('google.protobuf.Duration').create({
seconds: 30,
})
async function createJob(projectId, locationId, cron_date_time, jobDes) {
// [START cloud_scheduler_create_job]
const scheduler = require('@google-cloud/scheduler');
// Create a client.
const client = new scheduler.CloudSchedulerClient();
// Construct the fully qualified location path.
const parent = client.locationPath(projectId, locationId);
const job = {
httpTarget: {
uri: `https://my_api_endpoint`,
httpMethod: 'POST',
body: Buffer.from('Hello World')
},
//schedule: '02 12 27 7 *',
//schedule: 'MINUTES HOURS DAY MONTH DAY_OF_THE_WEEK',
schedule: cron_date_time,
//schedule: '6 6 28 7 *',
timeZone: 'Etc/UTC',
name: `projects/${projectId}/locations/${locationId}/jobs/${meetingEventId}`,
description: jobDes,
retryConfig: {
maxBackoffDuration: retryDuration,
maxDoublings: 3,
//maxRetryDuration: "30s",
minBackoffDuration: retryDuration,
retryCount: 3,
retryableStatusCodes: [500, 503]
}
};
}