Skip to content

Commit 8d8c603

Browse files
committed
Increase sync_updates cron expiration to 7 days and drop filter
Hardcode WEEK_IN_SECONDS for cron cleanup, matching the auto-draft cleanup precedent in core. Remove the wp_sync_updates_expiration filter to keep the API surface minimal for v1.
1 parent 4c76da5 commit 8d8c603

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

src/wp-includes/collaboration.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function wp_collaboration_inject_setting() {
2424
}
2525

2626
/**
27-
* Deletes sync updates older than 1 day from the wp_sync_updates table.
27+
* Deletes sync updates older than 7 days from the wp_sync_updates table.
2828
*
2929
* Rows left behind by abandoned collaborative editing sessions are cleaned up
3030
* to prevent unbounded table growth.
@@ -34,22 +34,10 @@ function wp_collaboration_inject_setting() {
3434
function wp_delete_old_sync_updates() {
3535
global $wpdb;
3636

37-
/**
38-
* Filters the lifetime, in seconds, of a sync update row.
39-
*
40-
* By default, the lifetime is 1 day. Once a row reaches that age, it will
41-
* automatically be deleted by a cron job.
42-
*
43-
* @since 7.0.0
44-
*
45-
* @param int $expiration The expiration age of a sync update row, in seconds.
46-
*/
47-
$expiration = apply_filters( 'wp_sync_updates_expiration', DAY_IN_SECONDS );
48-
4937
$wpdb->query(
5038
$wpdb->prepare(
5139
"DELETE FROM {$wpdb->sync_updates} WHERE created_at < %s",
52-
gmdate( 'Y-m-d H:i:s', time() - $expiration )
40+
gmdate( 'Y-m-d H:i:s', time() - WEEK_IN_SECONDS )
5341
)
5442
);
5543
}

0 commit comments

Comments
 (0)