Skip to content

Commit

Permalink
Make more clear the old completed invocation case
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Aug 16, 2024
1 parent cf1593b commit c21f618
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
17 changes: 17 additions & 0 deletions crates/storage-api/src/invocation_status_table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,5 +627,22 @@ mod test_util {
source_table: SourceTable::New,
}
}

pub fn mock_old() -> Self {
CompletedInvocation {
invocation_target: InvocationTarget::virtual_object(
"MyService",
"MyKey",
"mock",
VirtualObjectHandlerType::Exclusive,
),
source: Source::Ingress,
idempotency_key: None,
timestamps: StatusTimestamps::now(),
response_result: ResponseResult::Success(Bytes::from_static(b"123")),
completion_retention_duration: Duration::from_secs(60 * 60),
source_table: SourceTable::Old,
}
}
}
}
8 changes: 2 additions & 6 deletions crates/worker/src/partition/cleaner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,8 @@ mod tests {
),
(
not_expired_invocation_2,
InvocationStatus::Completed(CompletedInvocation {
completion_retention_duration: Duration::ZERO,
// StatusTimestamps::now() don't set the completed_transition_time()
timestamps: StatusTimestamps::now(),
..CompletedInvocation::mock_neo()
}),
// Old status invocations are still processed with the cleanup timer in the PP
InvocationStatus::Completed(CompletedInvocation::mock_old()),
),
(
not_completed_invocation,
Expand Down

0 comments on commit c21f618

Please sign in to comment.