From 11367b9803deca8015c4fd7a73435fc9f900f9d3 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 15 Jul 2023 00:21:24 -0400 Subject: [PATCH] refactor: add block cron to node client, but ensure it only runs on boot --- src/node/client.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/node/client.ts b/src/node/client.ts index e85d024..a72d536 100644 --- a/src/node/client.ts +++ b/src/node/client.ts @@ -25,4 +25,14 @@ export default class Client extends BaseClient { this.beaconUrl = config.beaconUrl; this.http.defaults.baseURL = this.beaconUrl; } + + async sync(): Promise { + await super.sync(); + + if (!this.booted) { + this.subscribe(); + + this.booted = true; + } + } }