Skip to content

Commit b7743c5

Browse files
committed
check if next and count is empty to stop
1 parent 10f7185 commit b7743c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/sync/class-sync-queue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ public function get_thread_state( $thread ) {
673673
$thread_queue = $this->get_thread_queue( $thread );
674674
$offset = time() - $thread_queue['ping'];
675675
$return = 3; // If autosync is running, default is ready/stalled.
676-
if ( empty( $thread_queue['next'] ) && 0 !== $thread_queue['next'] ) {
676+
if ( empty( $thread_queue['next'] ) && empty( $thread_queue['count'] ) ) {
677677
$return = 1; // Queue is empty, so nothing to sync, set as ended.
678678
} elseif ( ! empty( $thread_queue['ping'] ) && $offset < $this->cron_start_offset ) {
679679
$return = 2; // If the last ping is within the time frame, it's still active.

0 commit comments

Comments
 (0)