Skip to content

Commit 7e4bd4e

Browse files
author
Chris Gårdenberg
committed
fix: Set health-check as blocking, so we get an actual result, increase timeout to 0.5 seconds
1 parent 960e765 commit 7e4bd4e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

eduadmin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,8 @@ private function get_new_api_token() {
805805

806806
public function check_api_connection() {
807807
$api_check = wp_remote_head( "https://api.eduadmin.se/healthchecks", [
808-
'timeout' => 0.25,
809-
'blocking' => false,
808+
'timeout' => 0.5,
809+
'blocking' => true,
810810
] );
811811

812812
$this->api_connection = ! is_wp_error( $api_check ) && 200 === wp_remote_retrieve_response_code( $api_check );

src/eduadmin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,8 @@ private function get_new_api_token() {
805805

806806
public function check_api_connection() {
807807
$api_check = wp_remote_head( "https://api.eduadmin.se/healthchecks", [
808-
'timeout' => 0.25,
809-
'blocking' => false,
808+
'timeout' => 0.5,
809+
'blocking' => true,
810810
] );
811811

812812
$this->api_connection = ! is_wp_error( $api_check ) && 200 === wp_remote_retrieve_response_code( $api_check );

0 commit comments

Comments
 (0)