Moved sponsors cache creation until after diskcache is done.

refs #315
This commit is contained in:
softsimon 2021-01-30 22:12:22 +07:00
parent 6a9c4d82ec
commit f3c18b152a
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 8 additions and 9 deletions

View File

@ -16,14 +16,9 @@ class Donations {
sponsorsCache: any[] = [];
constructor() {
if (!config.SPONSORS.ENABLED) {
return;
}
this.$updateCache();
}
constructor() {}
async $updateCache() {
public async $updateCache() {
try {
this.sponsorsCache = await this.$getDonationsFromDatabase('handle, image');
} catch (e) {

View File

@ -85,12 +85,16 @@ class Server {
statistics.startStatistics();
}
fiatConversion.startService();
if (config.SPONSORS.ENABLED) {
donations.$updateCache();
}
this.setUpHttpApiRoutes();
this.setUpWebsocketHandling();
this.runMainUpdateLoop();
fiatConversion.startService();
if (config.BISQ_BLOCKS.ENABLED) {
bisq.startBisqService();
bisq.setPriceCallbackFunction((price) => websocketHandler.setExtraInitProperties('bsq-price', price));