summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/shepherd.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-03-05 00:08:39 +0100
committerFlorian Dold <florian@dold.me>2024-03-05 00:08:39 +0100
commit74fcd99c8d3dcbc1d1ac3086dce0a9ed0e07c519 (patch)
treea6243b78c635c04607eb4d40bcb3fc129173589b /packages/taler-wallet-core/src/shepherd.ts
parent695a6a43ea143475b2dddd070a2e16680b2bc9c7 (diff)
downloadwallet-core-74fcd99c8d3dcbc1d1ac3086dce0a9ed0e07c519.tar.gz
wallet-core-74fcd99c8d3dcbc1d1ac3086dce0a9ed0e07c519.tar.bz2
wallet-core-74fcd99c8d3dcbc1d1ac3086dce0a9ed0e07c519.zip
taler-wallet-cli: don't run task loop before init
Diffstat (limited to 'packages/taler-wallet-core/src/shepherd.ts')
-rw-r--r--packages/taler-wallet-core/src/shepherd.ts4
1 files changed, 3 insertions, 1 deletions
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) {