Permalink
Browse files

Buf fix in DoMaintain

Frank Betten noted about the old code "$Now - Modified($fname) < 0.5"
that the "left-hand side is in seconds, right-hand side in days".
This was fixed by replacing 0.5 with 12 * 60 * 60.
  • Loading branch information...
kensanata committed Feb 11, 2019
1 parent a45e13f commit 629693e353467a8121861f66e737a5c365e9b0d8
Showing with 1 addition and 1 deletion.
  1. +1 −1 wiki.pl
@@ -3921,7 +3921,7 @@ sub DoMaintain {
print GetHeader('', T('Run Maintenance')), $q->start_div({-class=>'content maintain'});
my $fname = "$DataDir/maintain";
if (not UserIsAdmin()) {
if (IsFile($fname) and $Now - Modified($fname) < 0.5) {
if (IsFile($fname) and $Now - Modified($fname) < 12 * 60 * 60) {
print $q->p(T('Maintenance not done.') . ' ' . T('(Maintenance can only be done once every 12 hours.)')
. ' ', T('Remove the "maintain" file or wait.')), $q->end_div();
PrintFooter();

0 comments on commit 629693e

Please sign in to comment.