diff options
-rw-r--r-- | packages/taler-wallet-cli/src/index.ts | 7 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/pay-merchant.ts | 2 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/shepherd.ts | 4 |
3 files changed, 3 insertions, 10 deletions
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index 9d25feb0f..b54e0e21f 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -1223,13 +1223,6 @@ advancedCli }; const wh = await createLocalWallet(args, onNotif, args.serve.noInit); const w = wh.wallet; - w.runTaskLoop() - .then((res) => { - logger.warn("task loop exited unexpectedly"); - }) - .catch((e) => { - logger.error(`error in task loop: ${e}`); - }); let nextClientId = 1; const notifyHandlers = new Map<number, (n: WalletNotification) => void>(); w.addNotificationListener((n) => { diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts index e92156572..05cbd26b7 100644 --- a/packages/taler-wallet-core/src/pay-merchant.ts +++ b/packages/taler-wallet-core/src/pay-merchant.ts @@ -1723,8 +1723,6 @@ async function waitPaymentResult( waitSessionId?: string, ): Promise<ConfirmPayResult> { const ctx = new PayMerchantTransactionContext(wex, proposalId); - - wex.taskScheduler.ensureRunning(); wex.taskScheduler.startShepherdTask(ctx.taskId); // FIXME: Clean up using the new JS "using" / Symbol.dispose syntax. diff --git a/packages/taler-wallet-core/src/shepherd.ts b/packages/taler-wallet-core/src/shepherd.ts index 6f2b2fa44..db090c352 100644 --- a/packages/taler-wallet-core/src/shepherd.ts +++ b/packages/taler-wallet-core/src/shepherd.ts @@ -162,7 +162,7 @@ export class TaskSchedulerImpl implements TaskScheduler { constructor(private ws: InternalWalletState) {} - async loadTasksFromDb(): Promise<void> { + private async loadTasksFromDb(): Promise<void> { const activeTasks = await getActiveTaskIds(this.ws); logger.info(`active tasks from DB: ${j2s(activeTasks)}`); @@ -227,6 +227,7 @@ export class TaskSchedulerImpl implements TaskScheduler { } startShepherdTask(taskId: TaskIdStr): void { + this.ensureRunning(); // Run in the background, no await! this.internalStartShepherdTask(taskId); } @@ -237,6 +238,7 @@ export class TaskSchedulerImpl implements TaskScheduler { * Mostly useful to interrupt all waits when time-travelling. */ reload() { + this.ensureRunning(); const tasksIds = [...this.sheps.keys()]; logger.info(`reloading sheperd with ${tasksIds.length} tasks`); for (const taskId of tasksIds) { |