Couldn't see a noob questions thread and couldn't see a specific express sub so apologies if I'm making a mistake by asking here.Anyhoo, I have a request handler where I read a db record and do some processing and return the result. Before I do I want to update the db to set the last_checked field to the current date. It's not critical that the last_check is updated so I was wondering if I could start the asynchronos db update and then issue a response.end() without waiting for it to finish.I've currently put the .end() in the resolve/reject handlers as doing it straight away on gut instinct seems like bad practice but equally from what I understand of how node handles async stuff I would expect it to work.Anyone care to throw some light on it, googling doesn't seem to give me the definitive answer I'm looking for. Cheers in advance for any replies.
Submitted September 06, 2018 at 12:19PM by theirongiant74
No comments:
Post a Comment