From c9fdb2c7ab6e5a32b4311fb91ef538b004c430f9 Mon Sep 17 00:00:00 2001 From: Jack Richards Date: Sun, 19 Nov 2023 11:41:48 +0000 Subject: [PATCH] Fixed typo in example json. Key should have been called name, not database. --- bptf-autopricer.js | 7 +++---- config.json | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bptf-autopricer.js b/bptf-autopricer.js index 4d00956..b8a9562 100644 --- a/bptf-autopricer.js +++ b/bptf-autopricer.js @@ -235,10 +235,6 @@ const calculateAndEmitPrices = async () => { } }; -(async () => { - await calculateAndEmitPrices(); -})(); - setInterval(async () => { await calculateAndEmitPrices(); }, 15 * 60 * 1000); // Every 15 minutes. @@ -321,6 +317,9 @@ schemaManager.init(async function(err) { if (err) { throw err; } + // Calculate and emit prices on startup. + await calculateAndEmitPrices(); + // Listen for events from the bptf socket. rws.addEventListener('message', event => { var json = JSON.parse(event.data); // forwards-compatible support of the batch mode, if you did not set the batch-test header. diff --git a/config.json b/config.json index ed96040..8d6c2f1 100644 --- a/config.json +++ b/config.json @@ -6,7 +6,7 @@ "schema": "tf2", "host": "localhost", "port": 5432, - "database": "backpacktf-ws", + "name": "backpacktf-ws", "user": "postgres", "password": "database password" },