How to wait to complete asynchronous functions during Windows shutdown?


#1

I want to wait to complete processing asynchronous functions during Windows shutdown.

I tried prevent Windows shutdown until all asynchronous funcitions completed.
But, the followings don’t work.
app.on('will-quit', event => event.preventDefault())
app.on('before-quit', event => event.preventDefault())

I would appreciate if you could answer it.
Please feel free to ask me if you have any questions.