#566494 follow-up by catch and David_Rothstein: Fixed Running cron in a shutdown function breaks the site.