Last active
May 16, 2018 16:53
-
-
Save erikhansen/d6edc492e1dbbb2dc58a0ccd794dd9a0 to your computer and use it in GitHub Desktop.
Magento 2 - Find CRON jobs that ran more than once at a given second
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SESSION group_concat_max_len = 1000000; | |
SELECT job_code, count(job_code) AS how_many_times_did_job_run_more_than_once, SUM(count) AS total_number_of_times_job_ran, GROUP_CONCAT(executed_at_group) AS executed_at FROM ( | |
SELECT cron_schedule.*, GROUP_CONCAT(cron_schedule.executed_at) AS executed_at_group, count(job_code) AS count FROM cron_schedule WHERE executed_at IS NOT NULL GROUP BY job_code, executed_at HAVING count(job_code) > 1 ORDER BY executed_at DESC | |
) AS duplicate_crons | |
GROUP BY job_code | |
ORDER BY count(job_code) DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job_code | how_many_times_did_job_run_more_than_once | total_number_of_times_job_ran | |
---|---|---|---|
sales_grid_order_creditmemo_async_insert | 36 | 260 | |
bulk_cleanup | 35 | 261 | |
sales_send_order_creditmemo_emails | 34 | 262 | |
sales_grid_order_invoice_async_insert | 33 | 263 | |
sales_send_order_emails | 33 | 262 | |
sales_send_order_invoice_emails | 33 | 263 | |
sales_send_order_shipment_emails | 33 | 261 | |
sales_grid_order_async_insert | 32 | 256 | |
consumers_runner | 32 | 157 | |
outdated_authentication_failures_cleanup | 32 | 262 | |
sales_grid_order_shipment_async_insert | 32 | 263 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment