Christian
Christian

Reputation: 1058

How to manage recurring Cloudfunctions with variable timeintervals?

Hi i am making a Moneymanagement app where i want to have the option to automatically create recurring payments. So when the user creates a transation on lets say 01.01.2020, i would do it like this:

transaction

then, if its possible, i want to make a cloudfunction that runs daily and checks

My questions are : How do i process dates ?

For example if the recurringDate == 28.01.2020 and intervall = weekly, it wouldn't make sense to set new recurringDate to 35.01.2020.

Is there a better way to do this ?

Thanks !

Upvotes: 0

Views: 53

Answers (1)

DazWilkin
DazWilkin

Reputation: 40081

See Scheduling compute instances with Cloud Scheduler which uses Cloud Scheduler

Because of the potential importance of the scheduling, you should strongly consider:

  • provide an audit trail of the schedules that you create for your users
  • a backup scheduling mechanism for when the GCP are unavailable

Upvotes: 2

Related Questions