BatchJobService
internal.internal.BatchJobService
Properties
__configModule__Record<string, unknown>__container__anyRequired__moduleDeclaration__Record<string, unknown>batchJobStatusMapToPropsMap<BatchJobStatus, { entityColumnName: string ; eventType: string }>Requiredmanager_EntityManagerRequiredtransactionManager_undefined | EntityManagerRequiredEventsobjectRequiredEvents.CANCELEDstringRequiredEvents.COMPLETEDstringRequiredEvents.CONFIRMEDstringRequiredEvents.CREATEDstringRequiredEvents.FAILEDstringRequiredEvents.PRE_PROCESSEDstringRequiredEvents.PROCESSINGstringRequiredEvents.UPDATEDstringRequiredAccessors
activeManager_
Protected get activeManager_(): EntityManager
Returns
EntityManager
EntityManagerEntityManagerRequiredInherited from
TransactionBaseService.activeManager_
Methods
atomicPhase_
Protected atomicPhase_<TResult, TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>
Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.
TResultobjectRequiredTErrorobjectRequiredParameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
Promise<TResult>
PromisePromise<TResult>RequiredInherited from
TransactionBaseService.atomicPhase_
cancel
cancel(batchJobOrId): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
complete
complete(batchJobOrId): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
confirm
confirm(batchJobOrId): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
create
create(data): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
listAndCount
listAndCount(selector?, config?): Promise<[BatchJob[], number]>
Parameters
selectorFilterableBatchJobPropsconfigFindConfig<BatchJob>Returns
Promise<[BatchJob[], number]>
prepareBatchJobForProcessing
prepareBatchJobForProcessing(data, req): Promise<CreateBatchJobInput>
Parameters
reqRequest<ParamsDictionary, any, any, ParsedQs, Record<string, any>>RequiredReturns
Promise<CreateBatchJobInput>
retrieve
retrieve(batchJobId, config?): Promise<BatchJob>
Parameters
batchJobIdstringRequiredconfigFindConfig<BatchJob>Returns
Promise<BatchJob>
setFailed
setFailed(batchJobOrId, error?): Promise<BatchJob>
Parameters
errorstring | BatchJobResultErrorReturns
Promise<BatchJob>
setPreProcessingDone
setPreProcessingDone(batchJobOrId): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
setProcessing
setProcessing(batchJobOrId): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
shouldRetryTransaction_
Protected shouldRetryTransaction_(err): boolean
Parameters
errRecord<string, unknown> | { code: string }RequiredReturns
boolean
booleanbooleanInherited from
TransactionBaseService.shouldRetryTransaction_
update
update(batchJobOrId, data): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
updateStatus
Protected updateStatus(batchJobOrId, status): Promise<BatchJob>
Parameters
Returns
Promise<BatchJob>
withTransaction
withTransaction(transactionManager?): BatchJobService
Parameters
transactionManagerEntityManager