Bug 6435: Add daemon mode to rebuild_zebra.pl
authorDoug Kingston <dpk@randomnotes.org>
Mon, 28 Oct 2013 00:18:17 +0000 (17:18 -0700)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 24 Nov 2013 18:12:21 +0000 (18:12 +0000)
commit1b0992e8d5a2bc8f0f74623daa9a7eac4786644a
treea9e3950186975b4cba1e63691c1fd9eef79f93ae
parent7021d36d0e58fe2acd0ae4ee7c9e658df2cc74be
Bug 6435: Add daemon mode to rebuild_zebra.pl

This change adds code to check the zebraqueue table with a cheap SQL query
and a daemon loop that checks for new entries and processes them incrementally
before sleeping for a controllable number of seconds.  The default is 5 seconds
which provides a near realtime search index update.  This is desirable particularly
for libraries that are doing active catalogue updating.  The query is adjusted
based on whether -a, -b, or -a -b are specified.

Help text updated.  Tested against a live 3.12 system.

Note that this fix will benefit from the fix to lack of locking (bug 11078)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
misc/migration_tools/rebuild_zebra.pl