In my project, I have a function that triggers the sending of emails every time a new element is added to the database. The function grabs email addresses for specific users and sends out emails accordingly.
Now, I'm running this function every time a new work child is created. However, I'm wondering if there's a way to check if the child has been in the database for more than 5 minutes.
My goal:
If the work
's property (available
) remains unchanged for 5 minutes, I want to resend the emails. While I could implement this using a timeout loop, I'm curious if there is a more efficient method available.