Skip to content

Instantly share code, notes, and snippets.

@mpchadwick
Created April 28, 2016 14:59
Show Gist options
  • Save mpchadwick/bd4c3b17b57799d7db527116277df5bc to your computer and use it in GitHub Desktop.
Save mpchadwick/bd4c3b17b57799d7db527116277df5bc to your computer and use it in GitHub Desktop.
long-running-crons.sql
# Find the crons that take the longest to run
# Note: kill_request will only be present if you have installed AOE_Scheduler
# And will only be used if your are running the watchdog task
SELECT
job_code,
executed_at,
finished_at,
schedule_id,
kill_request,
TIMEDIFF(finished_at, executed_at)
FROM cron_schedule
ORDER BY TIMEDIFF(finished_at, executed_at) DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment