Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions components/server/src/workspace/workspace-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,14 @@ export class WorkspaceService {
const lastActive =
instance?.stoppingTime || instance?.startedTime || instance?.creationTime || workspace?.creationTime;
if (!lastActive && !activeNow) {
log.warn(
{ userId, workspaceId },
"[updateDeletionEligibilityTime] No last active time found, skipping update of deletion eligibility time",
{
workspace,
instance,
},
);
return;
}
const deletionEligibilityTime = activeNow ? new Date() : new Date(lastActive);
Expand Down Expand Up @@ -567,7 +575,7 @@ export class WorkspaceService {
) {
log.warn(
{ userId, workspaceId, instanceId: instance?.id },
"Prevented moving deletion eligibility time backwards",
"[updateDeletionEligibilityTime] Prevented moving deletion eligibility time backwards",
{
hasGitChanges,
timestamps: new TrustedValue({
Expand All @@ -587,7 +595,11 @@ export class WorkspaceService {
deletionEligibilityTime: deletionEligibilityTime.toISOString(),
});
} catch (error) {
log.error({ userId, workspaceId }, "Failed to update deletion eligibility time", error);
log.error(
{ userId, workspaceId },
"[updateDeletionEligibilityTime] Failed to update deletion eligibility time",
error,
);
}
}

Expand Down
Loading