diff --git a/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php b/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php index 26ce95c675..0ea40e7539 100644 --- a/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php +++ b/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php @@ -89,11 +89,13 @@ public function test__should_back_off( ?int $backoff_factor, DateTime $dt, bool public function get_test_data__update_backoff_factor() { return [ - 'null' => [ null, 1 ], - 'zero' => [ 0, 1 ], - 'one' => [ 1, 2 ], - 'two' => [ 2, 4 ], - 'max' => [ 2048, 2048 ], + 'null' => [ null, 1 ], + 'zero' => [ 0, 1 ], + 'one_hour' => [ 1, 2 ], + 'two_hours' => [ 2, 4 ], + 'three_days' => [ 72, 144 ], + 'max' => [ 168, 168 ], + 'over_max' => [ 2000, 168 ], ]; } diff --git a/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php b/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php index 5ab64ed89a..c09079b99d 100644 --- a/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php +++ b/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php @@ -188,7 +188,7 @@ private function should_back_off(): bool { } if ( $backoff_factor > 0 ) { - $seconds_elapsed = time() - $last_heartbeat_timestamp; + $seconds_elapsed = time() - $this->last_heartbeat['timestamp']; $hours_elapsed = $seconds_elapsed / HOUR_IN_SECONDS; if ( $backoff_factor > $hours_elapsed ) {