lundi 25 novembre 2019

Node backend execute function after three days

I'm developing a web app with the MEVN stack and aws lambda. Users of the site are able to send requests to other users, but I'd like these requests to expire after three days. The function to delete a request is easy enough, but I don't know the best way to run it only after three days.

I don't want to setTimeout for that long, and I don't think Lambda would allow it anyway.

One way I could do it is just check if more than three days have passed the next time either of the two users log-on to the site, but I'd like to send an email when the request expires, and if neither user logs on for a month, the email wouldn't be sent until then.

Thanks so much for any help




Aucun commentaire:

Enregistrer un commentaire