Skip to content

Commit 4dc78cb

Browse files
improvement(redis-cleanup): schedule, async workflow, hitl base64 cache cleanup (#4646)
* improvement(redis-cleanup): schedule, async workflow, hitl bae64 cache cleanup * address comments
1 parent 08eeecb commit 4dc78cb

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

apps/sim/background/schedule-execution.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
import { preprocessExecution } from '@/lib/execution/preprocessing'
2222
import { LoggingSession } from '@/lib/logs/execution/logging-session'
2323
import { buildTraceSpans } from '@/lib/logs/execution/trace-spans/trace-spans'
24+
import { cleanupExecutionBase64Cache } from '@/lib/uploads/utils/user-file-base64.server'
2425
import {
2526
executeWorkflowCore,
2627
wasExecutionFinalizedByCore,
@@ -348,6 +349,8 @@ async function runWorkflowExecution({
348349
})
349350

350351
throw error
352+
} finally {
353+
void cleanupExecutionBase64Cache(executionId)
351354
}
352355
}
353356

apps/sim/background/workflow-execution.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { createTimeoutAbortController, getTimeoutErrorMessage } from '@/lib/core
77
import { preprocessExecution } from '@/lib/execution/preprocessing'
88
import { LoggingSession } from '@/lib/logs/execution/logging-session'
99
import { buildTraceSpans } from '@/lib/logs/execution/trace-spans/trace-spans'
10+
import { cleanupExecutionBase64Cache } from '@/lib/uploads/utils/user-file-base64.server'
1011
import {
1112
executeWorkflowCore,
1213
wasExecutionFinalizedByCore,
@@ -196,6 +197,8 @@ export async function executeWorkflowJob(payload: WorkflowExecutionPayload) {
196197
})
197198

198199
throw error
200+
} finally {
201+
void cleanupExecutionBase64Cache(executionId)
199202
}
200203
})
201204
}

apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { compactBlockLogs, compactExecutionPayload } from '@/lib/execution/payloads/serializer'
1717
import { preprocessExecution } from '@/lib/execution/preprocessing'
1818
import { LoggingSession } from '@/lib/logs/execution/logging-session'
19+
import { cleanupExecutionBase64Cache } from '@/lib/uploads/utils/user-file-base64.server'
1920
import { executeWorkflowCore } from '@/lib/workflows/executor/execution-core'
2021
import type { ExecutionEvent } from '@/lib/workflows/executor/execution-events'
2122
import { ExecutionSnapshot } from '@/executor/execution/snapshot'
@@ -1363,6 +1364,7 @@ export class PauseResumeManager {
13631364
})
13641365
})
13651366
}
1367+
void cleanupExecutionBase64Cache(resumeExecutionId)
13661368
}
13671369

13681370
if (executionError || !result) {

0 commit comments

Comments
 (0)