I'm working on a route that involves setting a data attribute called "active" to true initially, but then switching it to false after an hour. I'm curious if it's considered bad practice or feasible to use a setTimeout function within the express callback function like this:
app.get("/test", (req, res) => {
//Some code
SetTimeout(func, 3600);
});
I'm concerned about scalability - if this route is accessed frequently, will it become too costly? Appreciate any insights on this matter. Thanks!