diff options
author | Florian Dold <florian@dold.me> | 2024-03-05 00:08:39 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-03-05 00:08:39 +0100 |
commit | 74fcd99c8d3dcbc1d1ac3086dce0a9ed0e07c519 (patch) | |
tree | a6243b78c635c04607eb4d40bcb3fc129173589b /packages/taler-wallet-core/src | |
parent | 695a6a43ea143475b2dddd070a2e16680b2bc9c7 (diff) | |
download | wallet-core-74fcd99c8d3dcbc1d1ac3086dce0a9ed0e07c519.tar.xz |
taler-wallet-cli: don't run task loop before init
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/pay-merchant.ts | 2 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/shepherd.ts | 4 |
2 files changed, 3 insertions, 3 deletions
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) { |