@balena/open-balena-api 30.0.16 → 30.0.17-build-loki-d56a5e41e757d0329ae68a4cedb58d72ae927856-1
Sign up to get free protection for your applications and to get access to all the features.
@@ -59,14 +59,7 @@ export const store = async (req, res) => {
|
|
59
59
|
if (logs.length) {
|
60
60
|
const ctx = await getWriteContext(req);
|
61
61
|
// start publishing to both backends
|
62
|
-
await
|
63
|
-
getBackend().publish(ctx, logs),
|
64
|
-
shouldPublishToLoki()
|
65
|
-
? (await getLokiBackend()).publish(ctx, logs).catch((err) => {
|
66
|
-
captureException(err, 'Failed to publish logs to Loki');
|
67
|
-
})
|
68
|
-
: undefined,
|
69
|
-
]);
|
62
|
+
await publishBackend(getBackend(), ctx, logs);
|
70
63
|
}
|
71
64
|
res.status(201).end();
|
72
65
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../src/features/device-logs/lib/store.ts"],"names":[],"mappings":"AAQA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACd,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,oCAAoC,EACpC,uCAAuC,EACvC,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,EACL,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,GACzB,GAAG,MA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@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@balena/open-balena-api",
|
3
3
|
"description": "Internet of things, Made Simple",
|
4
|
-
"version": "30.0.
|
4
|
+
"version": "30.0.17-build-loki-d56a5e41e757d0329ae68a4cedb58d72ae927856-1",
|
5
5
|
"license": "AGPL-3.0",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
@@ -167,6 +167,6 @@
|
|
167
167
|
"loader": "ts-node/esm/transpile-only"
|
168
168
|
},
|
169
169
|
"versionist": {
|
170
|
-
"publishedAt": "2024-10-
|
170
|
+
"publishedAt": "2024-10-23T15:03:12.596Z"
|
171
171
|
}
|
172
172
|
}
|