Skip to content

Commit

Permalink
Bug/investigate startup issue logging (#192)
Browse files Browse the repository at this point in the history
* Add additional logging on startup error

* 2.10.10

* increase test timeout

* Increase logging in testing

* Revert "Increase logging in testing"

This reverts commit 727a963.
  • Loading branch information
mattdean-digicatapult authored Mar 13, 2024
1 parent c64ccce commit d532a70
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion app/keyWatcher/api.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'

import logger from '../logger.js'
import env from '../env.js'

export const createNodeApi = async () => {
const provider = new WsProvider(`ws://${env.NODE_HOST}:${env.NODE_PORT}`)
const api = new ApiPromise({ provider })

await api.isReadyOrError.catch(() => {}) // prevent unhandled promise rejection errors
await api.isReadyOrError.catch((e) => {
logger.error('Error thrown initialising API, message: %s', e?.message)
logger.debug('Error thrown initialising API, stack: %j', e?.stack)
}) // prevent unhandled promise rejection errors

return {
_api: api,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digicatapult/sqnc-ipfs",
"version": "2.10.9",
"version": "2.10.10",
"description": "IPFS node for use in SQNC",
"main": "app/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion test/mocharc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
recursive: true,
slow: 10000,
timeout: 20000,
timeout: 30000,
extension: ['.test.js'],
require: ['./test/integration/fixtures.js'],
exit: true,
Expand Down

0 comments on commit d532a70

Please sign in to comment.