hasura / hasura/graphql-engine

Add a 'run now' option to Cron Triggers

Open
#8,540 2 comments 14 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

In order to test development of Cronjobs it would be beneficial to run them when the supporting code has been updated to reflect a change. For now you have to set the Cron Trigger to once a minute in Hasura. This becomes a nuisance to wait and test your new implementation.

I propose **an option which runs the Cron Trigger immediately**, such as a 'Run now' button which bypasses the chosen Cron Schedule.

An alternative solution which might require less work on Hasura's side would be adding the possibility to be running multiple Cron Triggers (2-6) concurrently all at a one minute interval where the startdate differs in seconds, so that every 10/15/20/30 seconds the Cron Trigger is ran. Currently doing this will just trigger all Cron Triggers at the same second, every minute.

My alternative option for now has been a One-off Scheduled Events with a [timestamp in ISO8601 format](https://github.com/hasura/graphql-engine/issues/5079#issuecomment-644549168) which is set to a few seconds after the current time. The proposed solution has a _deprecated_ piece of documentation linked, a more robust solution should be in order.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.