showdown wait until all tasks complete and close db in finally block