X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fcompliance.php;h=6fd195f9b28503609ab6ae72afa8233d8b19cbf1;hb=b53b9de75a3240e36c52b42cd8334664040dc776;hp=fab5436809a59a5557438c595817363af0475940;hpb=7587a63f43a572955e533b66f197b7962383b13d;p=platal.git diff --git a/bin/cron/compliance.php b/bin/cron/compliance.php index fab5436..6fd195f 100755 --- a/bin/cron/compliance.php +++ b/bin/cron/compliance.php @@ -1,7 +1,7 @@ #!/usr/bin/php5 -q fetchOneCell())) { - echo "Orphaned sessions: found $count orphaned sessions. Please fix that.\n"; + $duration = time() - $begin; + echo "Orphaned sessions: found $count orphaned sessions in $duration seconds. Please fix that.\n"; } } @@ -86,13 +88,15 @@ function checkOrphanedSessions() { * Purges session events without a valid session. */ function purgeOrphanedEvents() { + $begin = time(); XDB::execute( "DELETE e FROM log_events AS e LEFT JOIN log_sessions AS s ON (s.id = e.session) WHERE s.id IS NULL"); $affectedRows = XDB::affectedRows(); - echo "Orphaned events: removed $affectedRows events.\n"; + $duration = time() - $begin; + echo "Orphaned events: removed $affectedRows events in $duration seconds.\n"; } // Remove expired sessions.