From dad8c07ec3f7241f9214b13738952d1c535ae081 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 3 Jun 2018 12:58:09 +0200 Subject: [PATCH] added 300ms curl timeout for the push_notifications added 300ms curl timeout for the push_notifications. otherwise the findblock cron will run default 300s timeout if a service goes down. (notifymyandroid is down.) --- include/classes/push_notification/notifymyandroid.php | 1 + include/classes/push_notification/pushover.php | 1 + 2 files changed, 2 insertions(+) diff --git a/include/classes/push_notification/notifymyandroid.php b/include/classes/push_notification/notifymyandroid.php index 923caad4..936a78fc 100644 --- a/include/classes/push_notification/notifymyandroid.php +++ b/include/classes/push_notification/notifymyandroid.php @@ -24,6 +24,7 @@ class Notifications_NotifyMyAndroid implements IPushNotification { public function notify($message, $severity = 'info', $event = null){ global $setting; curl_setopt_array($ch = curl_init(), array( + CURLOPT_TIMEOUT_MS => 300, CURLOPT_URL => "https://www.notifymyandroid.com/publicapi/notify", CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, diff --git a/include/classes/push_notification/pushover.php b/include/classes/push_notification/pushover.php index 3c232fed..6cd56fe3 100644 --- a/include/classes/push_notification/pushover.php +++ b/include/classes/push_notification/pushover.php @@ -27,6 +27,7 @@ public function notify($message, $severity = 'info', $event = null){ curl_setopt_array($ch = curl_init(), array( + CURLOPT_TIMEOUT_MS => 300, CURLOPT_URL => "https://api.pushover.net/1/messages.json", CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,