use addToCleanup instead of an END block.
This commit is contained in:
parent
5a25a44221
commit
89ea0e7cea
1 changed files with 4 additions and 7 deletions
|
|
@ -62,6 +62,7 @@ $creationDateSth->execute([$weekAgo, $weekStory->getId]);
|
|||
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->commit;
|
||||
addToCleanup($versionTag);
|
||||
|
||||
my $workflow = WebGUI::Workflow->create($session,
|
||||
{
|
||||
|
|
@ -70,6 +71,8 @@ my $workflow = WebGUI::Workflow->create($session,
|
|||
mode => 'realtime',
|
||||
},
|
||||
);
|
||||
addToCleanup($workflow);
|
||||
|
||||
my $activity = $workflow->addActivity('WebGUI::Workflow::Activity::ArchiveOldStories');
|
||||
|
||||
my $instance1 = WebGUI::Workflow::Instance->create($session,
|
||||
|
|
@ -118,10 +121,4 @@ $archivedAssets = $home->getLineage(
|
|||
);
|
||||
|
||||
cmp_bag( $archivedAssets, [ $weekStory->getId, $weekFolder->getId ], 'Nothing archived.');
|
||||
|
||||
END {
|
||||
$creationDateSth->finish;
|
||||
$versionTag->rollback;
|
||||
$workflow->delete;
|
||||
}
|
||||
|
||||
$creationDateSth->finish;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue