Fix database used when database disabled

This commit is contained in:
nymkappa 2023-02-15 17:45:29 +09:00
parent 5e10b75b87
commit 9734052477
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 4 additions and 2 deletions

View File

@ -127,7 +127,7 @@ class PoolsParser {
if (!equals(JSON.parse(existingPool.addresses), poolObj.addresses) || !equals(JSON.parse(existingPool.regexes), poolObj.regexes)) {
finalPoolDataUpdate.push(poolObj);
}
} else {
} else if (config.DATABASE.ENABLED) {
// Double check that if we're not just renaming a pool (same address same regex)
const [poolToRename]: any[] = await DB.query(`
SELECT * FROM pools

View File

@ -105,7 +105,9 @@ class Server {
.use(express.text({ type: ['text/plain', 'application/base64'] }))
;
await priceUpdater.$initializeLatestPriceWithDb();
if (config.DATABASE.ENABLED) {
await priceUpdater.$initializeLatestPriceWithDb();
}
this.server = http.createServer(this.app);
this.wss = new WebSocket.Server({ server: this.server });