mattporritt / moodle-search_elastic

An Elasticsearch engine plugin for Moodle's Global Search
https://moodle.org/plugins/search_elastic
GNU General Public License v3.0
16 stars 13 forks source link

The status check should only occur on the settings page itself #107

Closed jwalits closed 1 year ago

jwalits commented 1 year ago

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:

brendanheywood commented 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

dmitriim commented 1 year ago

Potentially related issue https://github.com/catalyst/moodle-search_elastic/issues/46

jjs105 commented 1 year ago

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.