StdScheduler.Clear().GetAwaiter() is not waiting for the clearing of the database to complete

5 views
Skip to first unread message

Shira Hammann

unread,
Jan 24, 2020, 1:37:07 AM1/24/20
to Quartz.NET
I am trying to clear out my db, wait for that to finish, and then populate my db. My application requires synchronous code at the top, so although I know calling .GetAwaiter() isn't ideal, I think I have to in order to work with Quartz's now-asynchronous API. I am calling .GetAwaiter() on the Clear method and want that to have completed before the next line of code executes, but it isn't waiting - that is, it seems to fire and forget the Clear request, and then continue on to the next line of code while the Clear logic is still executing. Is that intended? Is there any way to actually wait for the Clear's completion? In case it's useful, I've written out my question with an outline of the stack trace called here: https://stackoverflow.com/questions/59890147/getawaiter-not-working-to-wait-for-the-completion-of-quartz-librarys-clear-meth  . Many thanks!
Reply all
Reply to author
Forward
0 new messages