Disable Sync
-
How can we disable the Jetpack Sync cronjobs? It’s hammering our database and spamming our logs.
-
Sorry, that seems to be outdated and doesn’t say how to disable crons. I’ve got dozens of Jetpack cron jobs running: https://cloudup.com/cJrNKBLP9gJ
@tillkruess This discussion should give you some possible alternatives:
https://github.com/Automattic/jetpack/issues/5513You can use the filters I posted there to get more control over things. Could you also let met know your site URL, so I can take a closer look as to what could cause the sync jobs to get stuck like this?
Thanks!
@jeherve The site’s domain is
laylamartin.com
.Thanks! I see you also provided details on the GitHub issue; thanks a lot! We’ll look into this to try to understand why the sync jobs seem to get stuck on your site, thus adding up on your site instead of just following each other.
We’ll update the issue as soon as we make progress on this!
Hi,
I am not a coder so I tested whatever code I was able to find online in functions.php, still I can see both jobs run every minute.
I copied following code:
add_filter( 'jetpack_sync_listener_should_load', '__return_false' ); add_filter( 'jetpack_sync_sender_should_load', '__return_false' ); add_filter( 'jetpack_sync_incremental_sync_interval', function() { return 'daily'; } ); add_filter( 'jetpack_sync_full_sync_interval', function() { return 'daily'; } ); add_filter('schedule_event', function ($event) { return strpos($event->hook, 'jetpack_sync_') === 0 ? false : $event; }); function jp_support_5513_sync_schedule( $schedules ) { if ( ! isset( $schedules['10min'] ) ) { $schedules['100min'] = array( 'interval' => 100 * MINUTE_IN_SECONDS, 'display' => __( 'Every 100 minutes' ), ); } return $schedules; } add_filter( 'cron_schedules', 'jp_support_5513_sync_schedule' ); function __return_jp_support_5513_10_min() { return '100min'; } add_filter( 'jetpack_sync_incremental_sync_interval', '__return_jp_support_5513_10_min' ); add_filter( 'jetpack_sync_full_sync_interval', '__return_jp_support_5513_10_min' );
Nothing seems to work ??
@rohitmanglik Could you try to update to the most recent version of Jetpack? We’ve made several changes to Sync in the past few releases, and we’ve changed the Sync frequency as well.
Hi @jeherve
I am using latest version of Jetpack (4.5). https://pasteboard.co/ooBlFcaLH.png
I also tried to delete the event using WP Crontrol but I am not able to delete Jetpack jobs as well. https://pasteboard.co/ooxBbF84S.png
Can you please help with some temporary fix to disable them.
Thanks
@rohitmanglik The screenshot above shows that sync happens every 5 minutes now; we’ve also made sure it doesn’t block other jobs, get stuck, or take too long, so it should really be okay out of the box right now.
If you’d still prefer to skip using Cron for sync, you can use the following:
add_filter( 'pre_option_jetpack_sync_settings_sync_via_cron', '__return_zero' );
Thanks for fast response.
This is a screenshot of high CPU Usage: https://pasteboard.co/opwaPIK04.png because of Jetpack.
Also, the code given by you is also not working: https://pasteboard.co/opAmNTeOd.png – main site screenshot. I waited for 5 mins after pasting code in functions.php in main site.
Please note that Jetpack is Network Wide active.
Thanks
Could you let me know where you added the code snippet I posted earlier?
If this keeps happening, do you think you could contact us via this contact form and mention this thread so we can run more tests with you?
Thanks!
Hi @jeherve
I added it in functions.php in child theme.
`bitnami@wordpress-2-vm:/opt/bitnami/apps/wordpress/htdocs/wp-content/themes/eduma-child$ tail -f functions.php
‘jee-advanced–menu’ => __( ‘JEE Advanced Menu’, ‘eduma’ )
)
);
}add_action( ‘init’, ‘register_my_menus’ );
add_filter( ‘pre_option_jetpack_sync_settings_sync_via_cron’, ‘__return_zero’ );
?>`
Yes, I started a support thread for this.[#3016173].
- The topic ‘Disable Sync’ is closed to new replies.