View | Details | Raw Unified | Return to bug 24272
Collapse All | Expand All

(-)a/misc/maintenance/check_syspref_cache.pl (-2 / +12 lines)
Lines 16-21 Link Here
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use Getopt::Long;
20
use Pod::Usage;
19
21
20
use Koha::Script;
22
use Koha::Script;
21
use Koha::Caches;
23
use Koha::Caches;
Lines 36-41 Catch data inconsistencies in cached sysprefs vs those in the database Link Here
36
38
37
=cut
39
=cut
38
40
41
my ( $help, $man );
42
GetOptions(
43
    'help|?' => \$help,
44
    'man'    => \$man,
45
);
46
47
pod2usage(1) if $help;
48
pod2usage( -verbose => 2 ) if $man;
39
49
40
my $syspref_cache = Koha::Caches->get_instance('syspref');
50
my $syspref_cache = Koha::Caches->get_instance('syspref');
41
my $prefs = Koha::Config::SysPrefs->search();
51
my $prefs = Koha::Config::SysPrefs->search();
Lines 44-48 while (my $pref = $prefs->next) { Link Here
44
    my $var = lc $pref->variable;
54
    my $var = lc $pref->variable;
45
    my $cached_var = $syspref_cache->get_from_cache("syspref_$var");
55
    my $cached_var = $syspref_cache->get_from_cache("syspref_$var");
46
    next unless defined $cached_var; #If not defined in cache we will fetch from DB so this case is OK
56
    next unless defined $cached_var; #If not defined in cache we will fetch from DB so this case is OK
47
    print "$var: value in cache is $cached_var and value in db is ".$pref->value,"\n" unless $cached_var eq $pref->value;
57
    say sprintf( "%s: value in cache is '%s' and value in db is '%s'", $var, $cached_var, $pref->value )
58
      unless $cached_var eq $pref->value;
48
}
59
}
49
- 

Return to bug 24272