Merge branch 'master' into fix-template
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 7 Dec 2021 15:31:02 +0000 (16:31 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Dec 2021 15:31:02 +0000 (16:31 +0100)
src/assets/config-template.json
src/utils/Configuration.ts

index 7bee3ccd3ac914ba725cd397d469571662011cba..a0c0526abbf1a0c5c9266310cd17579d0ea80cb0 100644 (file)
@@ -4,7 +4,8 @@
   ],
   "distributeStationsToTenantsEqually": true,
   "performanceStorage": {
-    "enabled": true
+    "enabled": true,
+    "type": "jsonfile"
   },
   "chargingStationsPerWorker": 1,
   "workerProcess": "workerSet",
index 6777e8cc1d505c574102d86ebd8f8be1bbd85618..bf25445c00136eefcb85ed2e11acdf9e660f410c 100644 (file)
@@ -61,7 +61,9 @@ export default class Configuration {
       storageConfiguration =
       {
         ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'enabled') && { enabled: Configuration.getConfig().performanceStorage.enabled },
-        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'type') && { type: Configuration.getConfig().performanceStorage.type },
+        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'type')
+          ? { type: Configuration.getConfig().performanceStorage.type }
+          : { type: StorageType.JSON_FILE },
         ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'uri')
           ? { uri: Configuration.getConfig().performanceStorage.uri }
           : { uri: this.getDefaultPerformanceStorageUri(Configuration.getConfig()?.performanceStorage?.type ?? StorageType.JSON_FILE) }