Skip to content

Commit 316a325

Browse files
authored
fix(workflow-engine-*): Cleanup expired executions and reduce redis storage usage (medusajs#12795)
1 parent c0807f5 commit 316a325

File tree

14 files changed

+620
-392
lines changed

14 files changed

+620
-392
lines changed

.changeset/sixty-years-invite.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@medusajs/workflow-engine-inmemory": patch
3+
"@medusajs/workflow-engine-redis": patch
4+
"@medusajs/orchestration": patch
5+
"@medusajs/utils": patch
6+
---
7+
8+
fix(workflow-engine-*): Cleanup expired executions

packages/core/orchestration/src/transaction/datastore/abstract-storage.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export interface IDistributedTransactionStorage {
2121
key: string,
2222
options?: TransactionOptions & { isCancelling?: boolean }
2323
): Promise<TransactionCheckpoint | undefined>
24-
list(): Promise<TransactionCheckpoint[]>
2524
save(
2625
key: string,
2726
data: TransactionCheckpoint,
@@ -56,6 +55,7 @@ export interface IDistributedTransactionStorage {
5655
transaction: DistributedTransactionType,
5756
step: TransactionStep
5857
): Promise<void>
58+
clearExpiredExecutions(): Promise<void>
5959
}
6060

6161
export abstract class DistributedSchedulerStorage
@@ -92,10 +92,6 @@ export abstract class DistributedTransactionStorage
9292
throw new Error("Method 'get' not implemented.")
9393
}
9494

95-
async list(): Promise<TransactionCheckpoint[]> {
96-
throw new Error("Method 'list' not implemented.")
97-
}
98-
9995
async save(
10096
key: string,
10197
data: TransactionCheckpoint,
@@ -149,4 +145,8 @@ export abstract class DistributedTransactionStorage
149145
): Promise<void> {
150146
throw new Error("Method 'clearStepTimeout' not implemented.")
151147
}
148+
149+
async clearExpiredExecutions(): Promise<void> {
150+
throw new Error("Method 'clearExpiredExecutions' not implemented.")
151+
}
152152
}

packages/core/orchestration/src/transaction/datastore/base-in-memory-storage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ export class BaseInMemoryDistributedTransactionStorage extends DistributedTransa
4141
this.storage.set(key, data)
4242
}
4343
}
44+
45+
async clearExpiredExecutions(): Promise<void> {}
4446
}

0 commit comments

Comments
 (0)