fix: Use a global reference to distributed transaction and scheduler (#8462)
* fix: Add storage cleanup on scheduled jobs * fix: Use a global reference to distributed transaction and scheduler classes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Context, LoadedModule, MedusaContainer } from "@medusajs/types"
|
||||
import {
|
||||
DistributedTransaction,
|
||||
DistributedTransactionType,
|
||||
DistributedTransactionEvents,
|
||||
LocalWorkflow,
|
||||
TransactionStepError,
|
||||
@@ -36,7 +36,7 @@ export type FlowRegisterStepFailureOptions<TData = unknown> = {
|
||||
}
|
||||
|
||||
export type FlowCancelOptions = {
|
||||
transaction?: DistributedTransaction
|
||||
transaction?: DistributedTransactionType
|
||||
transactionId?: string
|
||||
context?: Context
|
||||
throwOnError?: boolean
|
||||
@@ -55,7 +55,7 @@ export type WorkflowResult<TResult = unknown> = {
|
||||
/**
|
||||
* The transaction details of the workflow's execution.
|
||||
*/
|
||||
transaction: DistributedTransaction
|
||||
transaction: DistributedTransactionType
|
||||
/**
|
||||
* The result returned by the workflow.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { MedusaModule } from "@medusajs/modules-sdk"
|
||||
import {
|
||||
DistributedTransaction,
|
||||
DistributedTransactionType,
|
||||
DistributedTransactionEvents,
|
||||
LocalWorkflow,
|
||||
TransactionHandlerType,
|
||||
@@ -66,7 +66,7 @@ function createContextualWorkflowRunner<
|
||||
isCancel = false,
|
||||
container: executionContainer,
|
||||
},
|
||||
transactionOrIdOrIdempotencyKey: DistributedTransaction | string,
|
||||
transactionOrIdOrIdempotencyKey: DistributedTransactionType | string,
|
||||
input: unknown,
|
||||
context: Context,
|
||||
events: DistributedTransactionEvents | undefined = {}
|
||||
@@ -483,7 +483,7 @@ function attachOnFinishReleaseEvents(
|
||||
const onFinish = events.onFinish
|
||||
|
||||
const wrappedOnFinish = async (args: {
|
||||
transaction: DistributedTransaction
|
||||
transaction: DistributedTransactionType
|
||||
result?: unknown
|
||||
errors?: unknown[]
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user