mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-10-22 18:18:06 +02:00
Adding timeout to fetch local files.
This commit is contained in:
1 parent
e78464f3b7
commit
151d2ba59f
1 file changed
+2
-1
@@ -58,7 +58,8 @@ class outagelib {
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 5); // Feching local files should be very fast.
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1); // It is localhost, time to connect is enough.
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 5); // It is localhost, time to fetch index is enough.
|
||||
$contents = curl_exec($curl);
|
||||
$mime = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
|
||||
curl_close($curl);
|
||||
|
||||
Reference in new issue
Block a user