I'm not sure about the automatic restart. In that implementation, I think it could start a loop of error, spaming logs and burning CPU (for ex, if the DB is down). 
So, at least we need to add a timeout (5 minutes ?) before next run if we want to keep that.