Skip to content

Commit

Permalink
Fix cleanup of old source archives
Browse files Browse the repository at this point in the history
A Red::Operators import was missing.
  • Loading branch information
patrickbkr committed Jun 4, 2023
1 parent 007bdb6 commit 3b06c29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/SourceArchiveCreator.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use OO::Monitors;
use Log::Async;
use DB;
use Config;
use Red::Operators:api<2>;

class X::ArchiveCreationException is Exception {
}
Expand Down Expand Up @@ -232,7 +233,7 @@ method clean-old-archives() {
for DB::CITestSet.^all.grep({
$_.source-archive-exists == True &&
$_.finished-at.defined &&
$_.finished-at < DateTime.now - config.source-archive-retain-days * 24 * 60 * 60
$_.finished-at < DateTime.now.earlier(days => config.source-archive-retain-days)
}) -> $test-set {
trace "Removing archives for " ~ $test-set.id ~ " finished at " ~ $test-set.finished-at;
my $filepath-base = self!get-path-for-name($test-set.source-archive-id, :create-dirs).relative($!work-dir);
Expand Down

0 comments on commit 3b06c29

Please sign in to comment.