Search code examples
google-cloud-platformgoogle-cloud-functionsgoogle-cloud-pubsub

Can I schedule a retry of a cloud function in nodejs?


When subscribing to a topic, I handle the ack/nack myself and can easily call message.nack(millisecondsToNextRetry).

I would like to do the same thing in cloud functions using nodejs, i.e. under certain circumstances retry the function after a specified time.

Anyone know a good solution or workaround when triggering a cloud function from pub/sub?


Solution

  • So, the workaround I've been using is Cloud Tasks, scheduling an invocation of the function at a specified time with the Pubsub payload. So I will ack the function and schedule a "retry" with Cloud Tasks at a specific point in time.