Home > Net >  How do graphQL engines like Hasura know to trigger jobs once even when they're scaled to multip
How do graphQL engines like Hasura know to trigger jobs once even when they're scaled to multip

Time:02-06

I deployed a few instances of the same Hasura server unto AWS ECS, I added a CRON job that I wanted to test out, and apparently the job is run only once (which is the ideal situation).

I was worried I'd have to figure out how to make sure jobs are run only once when I scale an instance horizontally, I'm not complaining, I would just like to know how that works, because I couldn't find it in the documentation.

CodePudding user response:

I can't find it in the documentation either, but Hasura appears to track scheduled cron jobs in the database, and I assume it is using a database locking mechanism to prevent a single job from running on more than one server at a time. Just like other similar job scheduling tools.

  •  Tags:  
  • Related