How to reschedule a task with Google Cloud Tasks

41 Views Asked by At

I'm implementing a feature to send an email to customers 24 hours after they uninstall our application. This is done by triggering a HTTP endpoint via Google Cloud Tasks, which checks if the application remains uninstalled before sending the email. The challenge arises as customers might reinstall and uninstall the application within this period. I aim to:

  • Ensure the email is sent only once
  • Delay the email to be sent 24 hours following the most recent uninstall event

My current implementation with Google Cloud Tasks handles de-duplication effectively, preventing multiple emails by disallowing task creation with duplicate IDs. However, I'm encountering limitations with rescheduling or postponing tasks because:

Given these constraints, how can I manage to have a task execute only once, 24 hours after the latest uninstall event, especially considering multiple uninstall/reinstall events can happen within the 24-hour timeframe?

0

There are 0 best solutions below