I would like the messenger bot to notify the user that their session ended if they did not write/give input to the bot for some time. In order to do so, I first thought about using setTimeout()
for each user which will reset upon activity. But that means if there will be 100 active users, there will be 100 Timeouts
at the same time.
I wanted to know, if having one Interval
instead that checks through each user`s session end timestamp every 30-60 seconds a better approach? The active users are stored in memory.