converted delete expired events hourly script
This commit is contained in:
parent
103969816e
commit
136a89ee7a
7 changed files with 134 additions and 56 deletions
|
|
@ -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;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue