0

Im having a cron job set up on a gcloud compute instance. It runs as expected on my local, but on the gcloud instance it waits until the first run and then starts to execute in an endless loop without a time gap.

async function runScript() {
    ...
}

cron.schedule("* */30 * * * *", () => {
  runScript();
});
Nidor
  • 85
  • 1
  • 5

1 Answers1

0

So I still dont know what the issue was, but I figured out a solution.

The cron-job needs to be setup in the following way:

cron.schedule("0 */30 * * * *", () => {

Now it also runs fine on the vm

Nidor
  • 85
  • 1
  • 5