On Wednesday, May 20, 2015 at 8:56:15 AM UTC-4, Sean Mitchell wrote:
>
> I have a database setup to log errors etc. Problem is I get an error 
> saying it can't be queued when quit has been invoked.
>
> if (results.PaginationResult.TotalNumberOfPages === 0 || 
> results.PaginationResult.TotalNumberOfEntries === 0) {
>                                 logEntry("No recent orders", "");
>                                 process.exit(1); 
>                             }
>
> So the query is never executed
>

Indeed: you'll have to wait for the query to finish before exiting -- if 
you have no more IO queued, node will exit on its own (though with a 
success status).

I'd add a callback to your logEntry method, have it call back when your 
database writes finish, and then call process.exit there.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/1e8fb1de-d154-4371-aae4-5f37c758db3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to