Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase delay between JP connection attempts #5090

Merged
merged 5 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Connection_Pilot {
/**
* Maximum number of hours that the system will wait to try to reconnect.
*/
const MAX_BACKOFF_FACTOR = 7 * 24;
const MAX_BACKOFF_FACTOR = 7 * 24 * 3;

/**
* The healtcheck option's current data.
Expand Down Expand Up @@ -204,8 +204,8 @@ private function should_back_off(): bool {
private function update_backoff_factor(): void {
$backoff_factor = isset( $this->last_heartbeat['backoff_factor'] ) ? (int) $this->last_heartbeat['backoff_factor'] : 0;

// Start at 1 hour, then double the backoff factor each time.
$backoff_factor = $backoff_factor <= 0 ? 1 : $backoff_factor * 2;
// Start at 1 hour, then multiply the backoff factor each time.
$backoff_factor = $backoff_factor <= 0 ? 1 : $backoff_factor * 6;

$this->update_heartbeat( min( $backoff_factor, self::MAX_BACKOFF_FACTOR ) );
}
Expand Down
Loading