Bugzilla – Attachment 172447 Details for
Bug 38104
share_usage_with_koha_community.pl: Check between two runs should be a bit lower than 30d
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38104: Adjust number of seconds in UsageStats::NeedUpdate
Bug-38104-Adjust-number-of-seconds-in-UsageStatsNe.patch (text/plain), 1.26 KB, created by
Marcel de Rooy
on 2024-10-07 09:30:04 UTC
(
hide
)
Description:
Bug 38104: Adjust number of seconds in UsageStats::NeedUpdate
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-10-07 09:30:04 UTC
Size:
1.26 KB
patch
obsolete
>From d82649c6e0d0a28bae8aafbcc8a10f194d099c6f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 7 Oct 2024 09:16:59 +0000 >Subject: [PATCH] Bug 38104: Adjust number of seconds in UsageStats::NeedUpdate >Content-Type: text/plain; charset=utf-8 > >Test plan: >Check pref UsageStatsLastUpdateTime >Run perl -MC4::UsageStats -e'print C4::UsageStats::NeedUpdate()' >Verify that it prints 1 only if time interval exceeds 4 weeks. >Temporarily clear this pref. >Run again. Should always print 1 now. >Restore pref value. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/UsageStats.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm >index 37b4a76ec4..bb9194c416 100644 >--- a/C4/UsageStats.pm >+++ b/C4/UsageStats.pm >@@ -25,6 +25,8 @@ use JSON qw( decode_json encode_json ); > > use Koha::Libraries; > >+use constant MIN_INTERVAL_BETWEEN_RUNS => 2419200; # 28 * 24 * 60 * 60 seconds >+ > =head1 NAME > > C4::UsageStats >@@ -51,7 +53,7 @@ sub NeedUpdate { > my $now = strftime( "%s", localtime ); > > # Need to launch cron. >- return 1 if $now - $lastupdated >= 2592000; >+ return 1 if $now - $lastupdated > MIN_INTERVAL_BETWEEN_RUNS; > > # Data don't need to be updated > return 0; >-- >2.39.5
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 38104
: 172447