Bugzilla – Attachment 86628 Details for
Bug 22473
Use koha-conf.xml modification time as cache key
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22473: flush in psgi - V1
Bug-22473-flush-in-psgi---V1.patch (text/plain), 1.57 KB, created by
Jonathan Druart
on 2019-03-14 18:30:35 UTC
(
hide
)
Description:
Bug 22473: flush in psgi - V1
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-03-14 18:30:35 UTC
Size:
1.57 KB
patch
obsolete
>From 031792f946ae79b81c2f19e8cfb9999a966a14a1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 7 Mar 2019 15:17:18 -0300 >Subject: [PATCH] Bug 22473: flush in psgi - V1 > >Here we are checking on each request > >That could work, but do not feel robust > >Moreover it will not affect scripts outside of plack >--- > debian/templates/plack.psgi | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi >index 3538b9a5a1..ce36d01e20 100644 >--- a/debian/templates/plack.psgi >+++ b/debian/templates/plack.psgi >@@ -46,6 +46,21 @@ use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise > $CGI::PARAM_UTF8 = 1; > Koha::Caches->flush_L1_caches(); > Koha::Cache::Memory::Lite->flush(); >+ >+ my $conf_fname = Koha::Config->guess_koha_conf; >+ my $conf_cache = Koha::Caches->get_instance('config'); >+ if ( $conf_cache->cache ) { >+ my $last_modification_time_cached = $conf_cache->get_from_cache('last_modification_time'); >+ my $last_modification_time = qx{stat --format %Y $conf_fname}; >+ unless ( $last_modification_time_cached ) { >+ $conf_cache->set_in_cache('last_modification_time', $last_modification_time) >+ } >+ elsif ( $last_modification_time > $last_modification_time_cached ) { >+ $conf_cache->flush_all; >+ $conf_cache->set_in_cache('last_modification_time', $last_modification_time) >+ } >+ } >+ > return $q; > }; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22473
: 86628 |
86629
|
86630
|
86631