X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fcompliance.php;h=fef927391626a6b4c4d646f16b5f55517227cfc8;hb=3424387cde6c635ff16c3b5459c4caa88bb76e2e;hp=6fd195f9b28503609ab6ae72afa8233d8b19cbf1;hpb=cece5392be5031db033f437b936e2dc463b54014;p=platal.git diff --git a/bin/cron/compliance.php b/bin/cron/compliance.php index 6fd195f..fef9273 100755 --- a/bin/cron/compliance.php +++ b/bin/cron/compliance.php @@ -1,7 +1,7 @@ #!/usr/bin/php5 -q = {?} AND a.uid < {?} + ORDER BY a.uid ASC) AS ut ON (ut.uid = s.uid) + WHERE s.start < DATE_SUB(NOW(), INTERVAL {?} MONTH) + AND s.start < ut.no_discard_limit", + $minimalBacklog - 1, $state, $isAdmin, $lowUID, $highUID, $retentionPeriod); + + $nbBatches += 1; + $affectedRows += XDB::affectedRows(); + } + + $duration = time() - $begin; + echo "Users with permission '$userPerms': removed $affectedRows sessions in $duration seconds ($nbBatches batches).\n"; } /** @@ -117,5 +139,5 @@ purgeOrphanedEvents(); XDB::execute("OPTIMIZE TABLE log_events"); XDB::execute("OPTIMIZE TABLE log_sessions"); -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>