@yarkivaev/scada 2.5.3 → 2.5.4
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.
package/package.json
CHANGED
|
@@ -120,7 +120,7 @@ function siteExtraRoutes(catalog, extraRoutes, syncRoutes) {
|
|
|
120
120
|
*/
|
|
121
121
|
export default async function siteServer(config) {
|
|
122
122
|
const env = collectionEnvironment(config);
|
|
123
|
-
const sink = supervisorSink(env);
|
|
123
|
+
const sink = supervisorSink(env, { stateData: config.stateData });
|
|
124
124
|
const ops = bindSiteOperations(sink, config.kindSources || config.operationSources);
|
|
125
125
|
const http = edgeApi(sink.dataAccess, {
|
|
126
126
|
port: sink.apiPort,
|
|
@@ -97,7 +97,8 @@ export default function supervisorSink(env = process.env, options = {}) {
|
|
|
97
97
|
if (cfg.pipeline.transactions.enabled) { cfg.pipeline.onBatch = segmentBatchStats(cfg.pipeline.transactions.statsIntervalMs); }
|
|
98
98
|
const pool = holdClient(new pg.Pool({ connectionString: cfg.postgres, max: cfg.dbPoolMax }));
|
|
99
99
|
const metricsEnabled = cfg.sinkDbProfile === 'edge';
|
|
100
|
-
const
|
|
100
|
+
const data = stateDataFromPool(pool, { metricsEnabled });
|
|
101
|
+
const dataAccess = options.stateData ? options.stateData(data, pool) : data;
|
|
101
102
|
return {
|
|
102
103
|
health: () => {return health.status()},
|
|
103
104
|
apiPort: cfg.apiPort,
|