Skip to content

Commit

Permalink
Merge pull request #368 from bitfinexcom/staging
Browse files Browse the repository at this point in the history
Release version to master
  • Loading branch information
prdn authored Apr 3, 2024
2 parents 908d9cb + ad04018 commit 9425c86
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
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

0 comments on commit 9425c86

Please sign in to comment.