clear TASK_GENERATE_PREVIEWS queue before waiting for it to be empty