ArchiveOldStories activity has to obey the TTL for activities.
This commit is contained in:
parent
5692106e85
commit
ca1f5e1c86
1 changed files with 4 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ sub execute {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $epoch = time();
|
my $epoch = time();
|
||||||
|
my $expireTime = $epoch + $self->getTTL();
|
||||||
my $getAnArchive = WebGUI::Asset::Wobject::StoryArchive->getIsa($session);
|
my $getAnArchive = WebGUI::Asset::Wobject::StoryArchive->getIsa($session);
|
||||||
ARCHIVE: while (my $archive = $getAnArchive->()) {
|
ARCHIVE: while (my $archive = $getAnArchive->()) {
|
||||||
next ARCHIVE unless $archive && $archive->get("archiveAfter");
|
next ARCHIVE unless $archive && $archive->get("archiveAfter");
|
||||||
|
|
@ -92,6 +93,9 @@ sub execute {
|
||||||
STORY: foreach my $story (@{ $stories }) {
|
STORY: foreach my $story (@{ $stories }) {
|
||||||
next STORY unless $story;
|
next STORY unless $story;
|
||||||
$story->update({ status => 'archived' });
|
$story->update({ status => 'archived' });
|
||||||
|
if (time() > $expireTime) {
|
||||||
|
return $self->WAITING(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$folder->update({ status => 'archived' });
|
$folder->update({ status => 'archived' });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue