fix(workflow-engine-*): Cleanup expired executions and reduce redis storage usage (#12795)
This commit is contained in:
@@ -21,7 +21,6 @@ export interface IDistributedTransactionStorage {
|
||||
key: string,
|
||||
options?: TransactionOptions & { isCancelling?: boolean }
|
||||
): Promise<TransactionCheckpoint | undefined>
|
||||
list(): Promise<TransactionCheckpoint[]>
|
||||
save(
|
||||
key: string,
|
||||
data: TransactionCheckpoint,
|
||||
@@ -56,6 +55,7 @@ export interface IDistributedTransactionStorage {
|
||||
transaction: DistributedTransactionType,
|
||||
step: TransactionStep
|
||||
): Promise<void>
|
||||
clearExpiredExecutions(): Promise<void>
|
||||
}
|
||||
|
||||
export abstract class DistributedSchedulerStorage
|
||||
@@ -92,10 +92,6 @@ export abstract class DistributedTransactionStorage
|
||||
throw new Error("Method 'get' not implemented.")
|
||||
}
|
||||
|
||||
async list(): Promise<TransactionCheckpoint[]> {
|
||||
throw new Error("Method 'list' not implemented.")
|
||||
}
|
||||
|
||||
async save(
|
||||
key: string,
|
||||
data: TransactionCheckpoint,
|
||||
@@ -149,4 +145,8 @@ export abstract class DistributedTransactionStorage
|
||||
): Promise<void> {
|
||||
throw new Error("Method 'clearStepTimeout' not implemented.")
|
||||
}
|
||||
|
||||
async clearExpiredExecutions(): Promise<void> {
|
||||
throw new Error("Method 'clearExpiredExecutions' not implemented.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,4 +41,6 @@ export class BaseInMemoryDistributedTransactionStorage extends DistributedTransa
|
||||
this.storage.set(key, data)
|
||||
}
|
||||
}
|
||||
|
||||
async clearExpiredExecutions(): Promise<void> {}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -80,7 +80,6 @@ const SPECIAL_PROPERTIES: {
|
||||
nullable: false,
|
||||
fieldName: field.fieldName,
|
||||
defaultRaw: "now()",
|
||||
onCreate: () => new Date(),
|
||||
})(MikroORMEntity.prototype, field.fieldName)
|
||||
},
|
||||
updated_at: (MikroORMEntity, field) => {
|
||||
@@ -90,8 +89,6 @@ const SPECIAL_PROPERTIES: {
|
||||
nullable: false,
|
||||
fieldName: field.fieldName,
|
||||
defaultRaw: "now()",
|
||||
onCreate: () => new Date(),
|
||||
onUpdate: () => new Date(),
|
||||
})(MikroORMEntity.prototype, field.fieldName)
|
||||
},
|
||||
deleted_at: (MikroORMEntity, field, tableName) => {
|
||||
|
||||
Reference in New Issue
Block a user