Closed ariefwt closed 5 years ago
Hi @ariefwt ,
this is a reasonale request and I would be happy to integrate this improvement.
However, I have two change requests:
LOCAL_STATICPAGE_AVAILABILITY_YES
LOCAL_STATICPAGE_AVAILABILITY_NO
LOCAL_STATICPAGE_AVAILABILITY_TIMEOUT
Thanks, Alex
Sorry for delayed response, but I've added timeout configuration and a more fine-grained response check as requested, as well as a control whether to check availability or not
Please review 😄
Hello @abias, how are things going? :-)
Hi @ariefwt,
I am sorry for the lack of feedback in this issue.
I will include your PR in our upcoming plugin release for Moodle 3.7. Please stay tuned for some more days.
Thanks, Alex
Hi @ariefwt ,
many thanks for your patience with this issue.
I finally was able to review your well-crafted pull request, do some refinements to align the code to the existing codebase (https://github.com/moodleuulm/moodle-local_staticpage/commit/1a49f63482f1c4cdec8d0eb52f7d04b4861d04b7) and merge it into master in the end.
Please expect the 3.7 release of the plugin which will contain this improvement within the next few days.
Hello, I'd like to suggest setting
CURLOPT_TIMEOUT
to ensure curl doesn't prevent the page from loading.A little backstory: In at least one of the deployments we handle, our customer's gateway is configured such that all outbound connections will go on indefinitely, and this in turn cause this function to keep waiting forever and ever.
In this pull request, the
CURLOPT_TIMEOUT
is set to a generous amount of 30 seconds (following the default PHPmax_execution_time
), but the number could come from configuration if needed be.This will also help to alleviate #32, which is similar but not as extreme as our customer's situation.