@@ -, +, @@ --- Koha/Patron.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -1179,13 +1179,18 @@ sub update_lastseen { my ( $self, $activity ) = @_; return $self if !C4::Context->preference('TrackLastPatronActivity'); - my $tracked_activities = { - map { ( lc $_, 1 ); } split /\s*\,\s*/, - C4::Context->preference('TrackLastPatronActivityTriggers') - }; + my $cache = Koha::Caches->get_instance(); + + my $tracked_activities = $cache->get_from_cache('tracked_activities'); + if ( !$tracked_activities ) { + $tracked_activities = { + map { ( lc $_, 1 ); } split /\s*\,\s*/, + C4::Context->preference('TrackLastPatronActivityTriggers') + }; + $cache->set_in_cache( 'tracked_activities', $tracked_activities ); + } return $self unless $tracked_activities->{$activity}; - my $cache = Koha::Caches->get_instance(); my $cache_key = "track_login_" . $self->userid; my $cached = $cache->get_from_cache($cache_key); my $now = dt_from_string(); --