Skip to content

Commit

Permalink
SonarCloud fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Sep 18, 2023
1 parent 238d6be commit 1ca34d0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
.vscode
/dist/client/bundle.js
/dist/client/bundle.js.LICENSE.txt
bundle.js
bundle.js.LICENSE.txt
.DS_Store
docker
8 changes: 7 additions & 1 deletion docker/chainviz.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM node:18.17.1-bookworm-slim
WORKDIR /usr/src/app
COPY . .
RUN adduser chainviz
COPY ./package.json ./
COPY ./tsconfig.json ./
COPY ./src ./src
COPY ./dist ./dist
RUN chown -R chainviz:chainviz /usr/src/app
USER chainviz
RUN npm install
RUN npm run build
EXPOSE 8080
Expand Down
12 changes: 7 additions & 5 deletions src/client/data/data-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ class DataStore {
async connectSubstrateRPC() {
try {
// connection timeout handling
await setAsyncTimeout(async (done) => {
this.substrateClient = await ApiPromise.create({
provider: new WsProvider(this.network.rpcURL),
});
done(0);
await setAsyncTimeout((done) => {
(async () => {
this.substrateClient = await ApiPromise.create({
provider: new WsProvider(this.network.rpcURL),
});
done(0);
})();
}, Constants.CONNECTION_TIMEOUT_MS);
this.eventBus.dispatch<string>(ChainvizEvent.SUBSTRATE_API_READY);
} catch (error) {
Expand Down

0 comments on commit 1ca34d0

Please sign in to comment.