OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
6 stars 0 forks source link

Schedule campaigns for slight delay in sending #156

Closed caldwellst closed 3 months ago

caldwellst commented 3 months ago

The push to HDX is quite slow due to the extensive Python installations. See the runs here. Thus, the data for Signals would not be reflected on HDX until approximately 10 minutes after the webhook is called. We probably want to delay sending emails until after the change is reflected on the HDX data. To do this, we can switch our send call to the Mailchimp API to a scheduling call.

Scheduling documentation is here. Scheduling can be done every quarter, so likely we would want to do something to calculate the time now, add ten minutes, then find the next quarter hour.

Sys.time() + lubridate::minutes(10) + # something
caldwellst commented 3 months ago

So, we can do lubridate::ceiling_date(x, "15 minutes") to get the next quarter hour from any time. But not so sure it's worth it to delay our mailing just so it reflects on HDX? Because it isn't the source data but simply the data from the alert which users will receive in their inbox.

caldwellst commented 3 months ago

I think probably best not to add this complexity for the moment, and the slight delay is understandable. Shall we close @hannahker @zackarno?

hannahker commented 3 months ago

Agreed on closing this.