https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38104

Marcel de Rooy <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #172447|0                           |1
        is obsolete|                            |

--- Comment #7 from Marcel de Rooy <[email protected]> ---
Created attachment 176674
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176674&action=edit
Bug 38104: Adjust number of seconds in UsageStats::NeedUpdate

The current interval between two HEA updates is hardcoded to
2592000 seconds, i.e. 30 days. This should be a bit lower
to compensate for shorter months (Feb) or a small difference
in execution time under cron.

This patch adjusts the 30 days to 27 days. This allows us to not
miss February too. Note that if you set it to 28 days, a few minutes
difference could already cause a HEA skip too.

Test plan:
Enable pref UsageStats.
Check pref UsageStatsLastUpdateTime (under Local use).
Keep the value X somewhere. (Don't worry if it was empty.)
You can convert this value X with:
  perl -MPOSIX -e 'print POSIX::strftime("%Y-%m-%d %H:%M:%S\n", localtime(X) )'
The current time is shown in seconds with:
  perl -e'print time()'

Enter a value like 1234 in UsageStatsLastUpdateTime. This should
trigger an update normally.
Run perl -MC4::UsageStats -e'print C4::UsageStats::NeedUpdate()'
This should print 1.
Now put the current time in seconds in the pref (see above).
Run perl -MC4::UsageStats -e'print C4::UsageStats::NeedUpdate()'
This should print 0.
[BONUS] Test with a value now - 26 days, now - 28 days.
Temporarily clear the pref.
Run again. Should print 1 again.
Restore pref value.
Disable UsageStats if it was not enabled.

Signed-off-by: Marcel de Rooy <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to