diff options
Diffstat (limited to 'packages/taler-wallet-core/src/shepherd.ts')
-rw-r--r-- | packages/taler-wallet-core/src/shepherd.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/shepherd.ts b/packages/taler-wallet-core/src/shepherd.ts index e8fddfc73..2fd260b11 100644 --- a/packages/taler-wallet-core/src/shepherd.ts +++ b/packages/taler-wallet-core/src/shepherd.ts @@ -41,7 +41,7 @@ import { processBackupForProvider } from "./backup/index.js"; import { DbRetryInfo, PendingTaskType, - TaskId, + TaskIdStr, TaskRunResult, TaskRunResultType, constructTaskIdentifier, @@ -104,7 +104,7 @@ function taskGivesLiveness(taskId: string): boolean { } export class TaskScheduler { - private sheps: Map<TaskId, ShepherdInfo> = new Map(); + private sheps: Map<TaskIdStr, ShepherdInfo> = new Map(); private iterCond = new AsyncCondition(); @@ -155,7 +155,7 @@ export class TaskScheduler { logger.info("Done with task loop."); } - startShepherdTask(taskId: TaskId): void { + startShepherdTask(taskId: TaskIdStr): void { // Run in the background, no await! this.internalStartShepherdTask(taskId); } @@ -176,7 +176,7 @@ export class TaskScheduler { } } - private async internalStartShepherdTask(taskId: TaskId): Promise<void> { + private async internalStartShepherdTask(taskId: TaskIdStr): Promise<void> { logger.trace(`Starting to shepherd task ${taskId}`); const oldShep = this.sheps.get(taskId); if (oldShep) { @@ -197,7 +197,7 @@ export class TaskScheduler { } } - stopShepherdTask(taskId: TaskId): void { + stopShepherdTask(taskId: TaskIdStr): void { logger.trace(`Stopping shepherding of ${taskId}`); const oldShep = this.sheps.get(taskId); if (oldShep) { @@ -208,12 +208,12 @@ export class TaskScheduler { } } - restartShepherdTask(taskId: TaskId): void { + restartShepherdTask(taskId: TaskIdStr): void { this.stopShepherdTask(taskId); this.startShepherdTask(taskId); } - async resetTaskRetries(taskId: TaskId): Promise<void> { + async resetTaskRetries(taskId: TaskIdStr): Promise<void> { const maybeNotification = await this.ws.db.runAllStoresReadWriteTx( async (tx) => { await tx.operationRetries.delete(taskId); @@ -228,7 +228,7 @@ export class TaskScheduler { } private async wait( - taskId: TaskId, + taskId: TaskIdStr, info: ShepherdInfo, delay: Duration, ): Promise<void> { @@ -240,7 +240,7 @@ export class TaskScheduler { } private async internalShepherdTask( - taskId: TaskId, + taskId: TaskIdStr, info: ShepherdInfo, ): Promise<void> { while (true) { @@ -423,7 +423,7 @@ async function storePendingTaskFinished( async function runTaskWithErrorReporting( ws: InternalWalletState, - opId: TaskId, + opId: TaskIdStr, f: () => Promise<TaskRunResult>, ): Promise<TaskRunResult> { let maybeError: TalerErrorDetail | undefined; @@ -510,7 +510,7 @@ async function runTaskWithErrorReporting( async function callOperationHandlerForTaskId( ws: InternalWalletState, - taskId: TaskId, + taskId: TaskIdStr, cancellationToken: CancellationToken, ): Promise<TaskRunResult> { const pending = parseTaskIdentifier(taskId); @@ -741,7 +741,7 @@ function convertTaskToTransactionId( } export interface ActiveTaskIdsResult { - taskIds: TaskId[]; + taskIds: TaskIdStr[]; } export async function getActiveTaskIds( |