Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version to master #368

Merged
merged 7 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfx-reports-framework",
"version": "4.16.0",
"version": "4.17.0",
"description": "Bitfinex reports framework",
"main": "worker.js",
"license": "Apache-2.0",
Expand Down
27 changes: 27 additions & 0 deletions workers/api.framework.report.wrk.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

const fs = require('node:fs')

const WrkReportServiceApi = require(
'bfx-report/workers/api.service.report.wrk'
)
Expand Down Expand Up @@ -143,6 +145,31 @@ class WrkReportFrameWorkApi extends WrkReportServiceApi {
}

this.setInitFacs(facs)
this.rmLokueDbIfJSONDamaged()
}

rmLokueDbIfJSONDamaged () {
for (const fac of this.conf.init.facilities) {
// eslint-disable-next-line no-unused-vars
const [type, facName, ns, label, opts] = fac

if (facName !== 'bfx-facs-lokue') {
continue
}

const { dbPathAbsolute, name } = opts
const baseLokueDbFileName = ['lokue', name, label].join('_')
const pathToLokueDbFile = path.join(
dbPathAbsolute,
`${baseLokueDbFileName}.db.json`
)

try {
require(pathToLokueDbFile)
} catch (err) {
fs.rmSync(pathToLokueDbFile, { force: true, maxRetries: 3 })
}
}
}

async initService (deps) {
Expand Down
8 changes: 7 additions & 1 deletion workers/loc.api/sync/progress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ class Progress extends EventEmitter {
return
}

const serializedError = (
progress?.serializedError ??
progress?.stack ??
progress
)

this.logger.error(
`PROGRESS:SYNC: ${progress.stack || progress}`
`PROGRESS:SYNC: ${serializedError}`
)
}

Expand Down
Loading