Skip to content

Commit 3b05869

Browse files
authored
Ensure that all schedulers are registered (#1959)
1 parent dc98545 commit 3b05869

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: added
3+
4+
Ensure that all schedulers are registered during every plugin update.

includes/class-migration.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,10 @@ public static function maybe_migrate() {
160160
add_action( 'init', 'flush_rewrite_rules', 20 );
161161
}
162162
if ( \version_compare( $version_from_db, '5.0.0', '<' ) ) {
163-
Scheduler::register_schedules();
164163
\wp_schedule_single_event( \time(), 'activitypub_upgrade', array( 'create_post_outbox_items' ) );
165164
\wp_schedule_single_event( \time() + 15, 'activitypub_upgrade', array( 'create_comment_outbox_items' ) );
166165
add_action( 'init', 'flush_rewrite_rules', 20 );
167166
}
168-
if ( \version_compare( $version_from_db, '5.2.0', '<' ) ) {
169-
Scheduler::register_schedules();
170-
}
171167
if ( \version_compare( $version_from_db, '5.4.0', '<' ) ) {
172168
\wp_schedule_single_event( \time(), 'activitypub_upgrade', array( 'update_actor_json_slashing' ) );
173169
\wp_schedule_single_event( \time(), 'activitypub_upgrade', array( 'update_comment_author_emails' ) );
@@ -203,6 +199,9 @@ public static function maybe_migrate() {
203199
}
204200
}
205201

202+
// Ensure all required cron schedules are registered.
203+
Scheduler::register_schedules();
204+
206205
/*
207206
* Add new update routines above this comment. ^
208207
*

0 commit comments

Comments
 (0)