From 305111bcd30bce647c8e76f25bc5eed40fd061bf Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Fri, 16 Aug 2019 10:58:20 +0100 Subject: [PATCH] MDL-65970 airnotifier: Set lower timeout for Push curl requests --- message/output/airnotifier/message_output_airnotifier.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/message/output/airnotifier/message_output_airnotifier.php b/message/output/airnotifier/message_output_airnotifier.php index 5fb3c2e082a..004185a38da 100644 --- a/message/output/airnotifier/message_output_airnotifier.php +++ b/message/output/airnotifier/message_output_airnotifier.php @@ -117,6 +117,8 @@ class message_output_airnotifier extends message_output { $header = array('Accept: application/json', 'X-AN-APP-NAME: ' . $CFG->airnotifierappname, 'X-AN-APP-KEY: ' . $CFG->airnotifieraccesskey); $curl = new curl; + // Push notifications are supposed to be instant, do not wait to long blocking the execution. + $curl->setopt(array('CURLOPT_TIMEOUT' => 2, 'CURLOPT_CONNECTTIMEOUT' => 2)); $curl->setHeader($header); $params = array(