Closed jwalits closed 1 year ago
There is probably a few other things to do, if this killed the site then the check is broken even on the settings page it should run on. The curl call must have a timeout, and a short one like 2 seconds. If the engine doesn't respond in 2 seconds then it should be consider as broken.
This should also get rewritten as a status check using the check api
Potentially related issue https://github.com/catalyst/moodle-search_elastic/issues/46
We have also just run into this issue. @jwalits suggestion of a current settings page check is one option.
Another option may be to make this into a user initiated action - i.e. have a 'check connection' button on the page.
It appears as though this check occurs on every single admin page. There should be a check around the status check call, so it only occurs on the plugin settings page
https://github.com/catalyst/moodle-search_elastic/blob/MOODLE_310_STABLE/settings.php#L31-L38
Its probably not an issue on a staging/production site, where this elasticsearch should be configured properly, but this killed site locally (after restore) till we were able to debug and pin-point the root cause.
E.g of such check in another plugin: https://github.com/ncstate-delta/moodle-mod_zoom/blob/main/settings.php#L38
Tasks: