From c5c0abb7a6d58b224ab67a8b0550be95f494d405 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Fri, 26 Jun 2020 12:39:56 -0400 Subject: [PATCH] have mig-import remove memcache keys and restart plack --- kmig.d/bin/mig-import | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/kmig.d/bin/mig-import b/kmig.d/bin/mig-import index 0f075b5..a7df5ac 100755 --- a/kmig.d/bin/mig-import +++ b/kmig.d/bin/mig-import @@ -204,7 +204,14 @@ sub most_recent_single { sub reset_memcache { my $instance = shift; - print "instance is $instance\n"; + my $aptcheck = `sudo dpkg -l | grep 'libmemcached-tools'`; + if (!defined $aptcheck or length($aptcheck) < 1) { + print "!!! !!! !!! WARNING WARNING WARNING: libmemcached-tools is not installed, removing keys will not be attempted\n"; + return; + } + + system("sudo memcdump --servers localhost | grep '$instance:' | grep 'syspref\|MarcStructure\|AuthorisedValues\|MarcSubfieldStructure' | xargs memcrm --servers localhost"); + system("sudo koha-plack --restart $instance"); return; } -- 1.7.2.5