added automatic purging of old asset revisions
This commit is contained in:
parent
e7d282c730
commit
eb3115d3f9
7 changed files with 125 additions and 24 deletions
|
|
@ -13,7 +13,6 @@ package Hourly::DeleteExpiredClipboard;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
|
|
@ -21,9 +20,9 @@ use WebGUI::SQL;
|
|||
sub process {
|
||||
if ($session{config}{DeleteExpiredClipboard_offset} ne "") {
|
||||
my $expireDate = (time()-(86400*$session{config}{DeleteExpiredClipboard_offset}));
|
||||
my $sth = WebGUI::SQL->read("select assetId,className from asset where state='clipboard' and lastUpdated <".$expireDate);
|
||||
my $sth = WebGUI::SQL->read("select assetId,className from asset where state='clipboard' and stateChanged <".$expireDate);
|
||||
while (my ($id, $class) = $sth->array) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($id,$class);
|
||||
my $asset = WebGUI::Asset->new($id,$class);
|
||||
$asset->trash;
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue