Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Outbox: Register new event schedule on upgrade
Browse files Browse the repository at this point in the history
obenland committed Jan 28, 2025
1 parent 66007a5 commit 4ac782b
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions includes/class-migration.php
Original file line number Diff line number Diff line change
@@ -174,6 +174,7 @@ public static function maybe_migrate() {
add_action( 'init', 'flush_rewrite_rules', 20 );
}
if ( \version_compare( $version_from_db, 'unreleased', '<' ) ) {
Scheduler::register_schedules();
\wp_schedule_single_event( \time(), 'activitypub_upgrade', array( 'create_post_outbox_items' ) );
\wp_schedule_single_event( \time() + 15, 'activitypub_upgrade', array( 'create_comment_outbox_items' ) );
}
1 change: 1 addition & 0 deletions includes/class-scheduler.php
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ public static function register_schedules() {
public static function deregister_schedules() {
wp_unschedule_hook( 'activitypub_update_followers' );
wp_unschedule_hook( 'activitypub_cleanup_followers' );
wp_unschedule_hook( 'activitypub_reprocess_outbox' );
}

/**

0 comments on commit 4ac782b

Please sign in to comment.