Description
Tomás Cohen Arazi (tcohen)
2023-03-01 13:20:23 UTC
Created attachment 147560 [details] [review] Bug 33108: Add is_elasticsearch_enabled method to tools This patch adds a way to query if an instance is configured to use ES. To test: 1. Apply this patch 2. Enter KTD as root: $ ktd --shell --root 3. Run: $ source /kohadevbox/koha/debian/scripts/koha-functions.sh 4. Run: $ is_elasticsearch_enabled hola => FAIL: Instance hola doesn't exist (hopefully :-P) 5. Have the SearchEngine syspref set to Elasticsearch 6. Run: $ is_elasticsearch_enabled kohadev && echo "it is" || echo "it isn't" => SUCCESS: "it is" gets printed 7. Set SearchEngine to Zebra 8. Repeat 6 => SUCCESS: "it isn't" gets printed 9. Sign off :-D Created attachment 147574 [details] [review] Bug 33108: koha-es-indexer added Created attachment 147575 [details] [review] Bug 33108: Teach koha-list filter elasticsearch Created attachment 147576 [details] [review] Bug 33108: Make init handle koha-es-indexer Created attachment 147617 [details] [review] Bug 33108: koha-es-indexer added Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 147618 [details] [review] Bug 33108: Teach koha-list filter elasticsearch Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 147619 [details] [review] Bug 33108: Make init handle koha-es-indexer Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 147620 [details] [review] Bug 33108: (follow-up) Don't die, only warn if not using ES (In reply to Nick Clemens from comment #8) > Created attachment 147620 [details] [review] [review] > Bug 33108: (follow-up) Don't die, only warn if not using ES Why that? Typo several time in debian/koha-common.init + koha-es-indexer --start --quiet $(koha-list --enabled --elasticsearcvh) Once I fixed the typo: % restart_all Restarting Apache httpd web server: apache2. Restarting Koha ILS: koha-commonStopping Plack daemon for kohadev:. Stopping Z39.50/SRU daemon for kohadev:. Stopping Koha worker daemon for kohadev (default):. Stopping Koha worker daemon for kohadev (long_tasks):. Stopping Koha indexing daemon for kohadev:. Error: ES indexing daemon not running for kohadev: failed! failed! Created attachment 147701 [details] [review] Bug 33108: (follow-up) Fix typo Created attachment 147702 [details] [review] Bug 33108: (follow-up) Don't let restart die if ES indexer not running This fixes the restart action in koha-common to continue with starting services even if the last service cannot be stopped (because it may not be running) This needs a larger fix, to ensure all stopped services return a warning, for now 'do_stop' simply returns the last success/failure To test: 1 - Apply patch 2 - reset_all 3 - sudo koha-es-indexer --stop kohadev 4 - restart_all 5 - You are notified that ES indexer was not running 6 - You are notified that soem services could not be stopped 7 - The services are started Created attachment 148328 [details] [review] Bug 33108: koha-es-indexer added Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 148329 [details] [review] Bug 33108: Teach koha-list filter elasticsearch Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 148330 [details] [review] Bug 33108: Make init handle koha-es-indexer Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Bug 33108: (follow-up) Fix typo Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 148331 [details] [review] Bug 33108: (follow-up) Don't die, only warn if not using ES Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 148332 [details] [review] Bug 33108: (follow-up) Don't let restart die if ES indexer not running This fixes the restart action in koha-common to continue with starting services even if the last service cannot be stopped (because it may not be running) This needs a larger fix, to ensure all stopped services return a warning, for now 'do_stop' simply returns the last success/failure To test: 1 - Apply patch 2 - reset_all 3 - sudo koha-es-indexer --stop kohadev 4 - restart_all 5 - You are notified that ES indexer was not running 6 - You are notified that soem services could not be stopped 7 - The services are started Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 23.05. Nice work everyone, thanks! Many hands makes light work, thankyou everyone! Pushed to 22.11.x for the next release |