Delayed messages
Unanswered
Cape May Warbler posted this in #help-forum
Cape May WarblerOP
Hey, I want to make a service that would delay receiving of sent message by some amount, say 8 hours, so that after person A sent the message to the person B, person B will be available to get this message after 8 hours. What would be best approach for that? Cron jobs? I'm still thinking about hosting, it most likely will be self hosted but might be on vercel. Are Cron jobs and special endpoint way to go?
2 Replies
The best way to do this would be through a database. Simply have a database that has a delivery date and a status. All your front end does is insert and read the database. Then have another Service that runs periodically (every 5 minutes? every minute?) that checks for status of 'Incomplete' and if the delivery time is in the past, send that message and update the database.
Then on the front end, it would show as delivered.
Then on the front end, it would show as delivered.
Cape May WarblerOP
Just like I thought, I'll wait for more solutions before I decide tho