I was asked this by a colleague: what about setInterval(). The answer is "yes" it works as a continuation:
setInterval()
app.get('/path', cls.$init(function handler(req,res) { cls.audit = async function(message, content) { await mysql.insert(...); } ... cls.timerInterval = setInterval(checkSomething, 60000); })) function checkSomething() { cls.audit("checked", {time: Date.now()}) if(somethingHappenend) clearInterval(cls.timerInterval); }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was asked this by a colleague: what about
setInterval()
. The answer is "yes" it works as a continuation: