converted delete expired events hourly script

This commit is contained in:
JT Smith 2006-03-01 19:59:24 +00:00
parent 103969816e
commit 136a89ee7a
7 changed files with 134 additions and 56 deletions

View file

@ -1,32 +0,0 @@
package Hourly::DeleteExpiredEvents;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use strict;
use WebGUI::DateTime;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset::Event;
#-----------------------------------------
sub process {
if ($session{config}{DeleteExpiredEvents_offset} ne "") {
my $sth = WebGUI::SQL->read("select assetId from EventsCalendar_event where eventEndDate < ".(time()-(86400*$session{config}{DeleteExpiredEvents_offset})));
while (my ($id) = $sth->array) {
WebGUI::Asset::Event->new($id)->purge;
}
$sth->finish;
}
}
1;