Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear unused scheduled events in wp_options cron. #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bi0xid
Copy link

@bi0xid bi0xid commented Jul 16, 2016

Clears unused scheduled events in wp_options cron before adding a new
scheduled event. Prevents server exhaustion and several problems when having heavy loads of information in wp_options cron.

Solves
https://disqus.com/home/channel/discussdisqus/discussion/channel-discuss
disqus/tons_of_dsq_sync_forum_entries_in_cron_row_wp_options_and_10x_ser
ver_loads/
Solves
https://wordpress.org/support/topic/high-server-load-and-dsq_sync_forum-
problem

Clears unused scheduled events in wp_options cron before adding a new
scheduled event.
Solves
https://disqus.com/home/channel/discussdisqus/discussion/channel-discuss
disqus/tons_of_dsq_sync_forum_entries_in_cron_row_wp_options_and_10x_ser
ver_loads/
Solves
https://wordpress.org/support/topic/high-server-load-and-dsq_sync_forum-
problem
@archon810
Copy link
Contributor

This will just continue clearing and postponing and never running the Disqus sync cron job on a busy server.

@@ -510,6 +510,7 @@ function dsq_request_handler() {
die('// synced '.$comments.' comments');
}
} else {
wp_clear_scheduled_hook( 'dsq_sync_forum' );
$ts = time() + 300;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may not work. Rather ba0a89e is better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants