Friday, 17 July 2020

implementing appointment feature issue

Hi guys,I am playing with Postgresql notify feature using Node js as an API and i'm trying to figure out how to notify Node every two hours if user has not responded.To make things clearer, user A asks for an appointment with user B. user B needs to confirm that appointment. If he doesn't confirm within 2 hours, notify him.Appointments table has the following columns :ID : PKsender_id : FK -> User Areceiver_id: FK -> User BdateList : ARRAY[DATE]current_timestamp : TIMEconfirmation_status : BooleanUsing pg_notify, postgres can notify the API on INSERT, UPDATE and DELETE. But i need a current_timestamp watcher to compare it with the server timestamp. How can i achieve that ? I have no clue at the moment, i know pg_cron could be used.Any tips would be appreciated.Thank you guys.

Submitted July 17, 2020 at 12:54PM by Surikaate

No comments:

Post a Comment