Sort queued jobs by next run time, allow to queue failed jobs