Skip to content

Commit

Permalink
#fix: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Oct 24, 2023
1 parent d4b8456 commit 410e983
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion lib/db/clickhouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,13 @@ const outputTempoSearch = async (dataStream, res) => {
*/
const preprocessStream = (rawStream, processors) => {
let dStream = StringStream.from(rawStream.data).lines().endWith(JSON.stringify({ EOF: true }))
.map(chunk => chunk ? JSON.parse(chunk) : ({}), DataStream)
.map(chunk => {
try {
return chunk ? JSON.parse(chunk) : ({})
} catch (e) {
return {}
}
}, DataStream)
.map(chunk => {
try {
if (!chunk || !chunk.labels) {
Expand Down
1 change: 0 additions & 1 deletion lib/handlers/prom_query_range.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ async function handler (req, res) {
const query = req.query.query
try {
const result = await rangeQuery(query, startMs, endMs, stepMs)
console.log(JSON.stringify(result))
return res.code(200).send(result)
} catch (err) {
return res.code(500).send(JSON.stringify({ status: 'error', error: err.message }))
Expand Down
2 changes: 1 addition & 1 deletion lib/handlers/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function handler (req, res) {
req.log.debug('POST /loki/api/v1/push')
if (!req.body) {
await processRawPush(req, DATABASE.cache.labels, bulk_labels, bulk,
toJSON, fingerPrint)
toJson, fingerPrint)
return res.code(200).send()
}
if (readonly) {
Expand Down

0 comments on commit 410e983

Please sign in to comment.