@dhedge/backend-flatcoin-core 0.2.88 → 0.2.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,5 @@ export declare class ConfigService {
|
|
|
6
6
|
private readonly logger;
|
|
7
7
|
private baseConfig;
|
|
8
8
|
constructor(configRepository: MultichainConfigRepository, logger: Logger);
|
|
9
|
-
baseConfigs(): MultichainConfig
|
|
10
|
-
refreshConfigs(): Promise<void>;
|
|
9
|
+
baseConfigs(): Promise<MultichainConfig>;
|
|
11
10
|
}
|
|
@@ -16,24 +16,23 @@ let ConfigService = class ConfigService {
|
|
|
16
16
|
constructor(configRepository, logger) {
|
|
17
17
|
this.configRepository = configRepository;
|
|
18
18
|
this.logger = logger;
|
|
19
|
-
this.refreshConfigs().catch();
|
|
20
19
|
}
|
|
21
|
-
baseConfigs() {
|
|
20
|
+
async baseConfigs() {
|
|
22
21
|
if (this.baseConfig) {
|
|
23
22
|
return this.baseConfig;
|
|
24
23
|
}
|
|
25
24
|
else {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
const result = await this.configRepository.getById(1);
|
|
26
|
+
if (!result) {
|
|
27
|
+
throw new Error('failed to load multichain config from db');
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
if (!this.baseConfig) {
|
|
31
|
+
this.baseConfig = result;
|
|
32
|
+
this.logger.log(`multichain config loaded ${result}`);
|
|
33
|
+
}
|
|
34
|
+
return this.baseConfig;
|
|
35
|
+
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
};
|