diff --git a/helpers/NotificationHelper.php b/helpers/NotificationHelper.php index 179043f..4ffa01a 100644 --- a/helpers/NotificationHelper.php +++ b/helpers/NotificationHelper.php @@ -20,6 +20,12 @@ class NotificationHelper curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); + // A slow-but-not-fully-hung hookshot endpoint could otherwise add up + // to the full CURLOPT_TIMEOUT per fire() call, and a single request + // can call fire() (via notifyWatchers/sendCommentNotification/etc.) + // more than once sequentially — capping just the connect phase keeps + // that from stacking into tens of seconds of added latency. + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);