Skip to content

Commit 3f42164

Browse files
committedMay 7, 2024
fix(web-console): align displayed timings with real fetch time
1 parent 87a3359 commit 3f42164

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed
 

‎packages/web-console/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@questdb/web-console",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"license": "Apache-2.0",
55
"description": "QuestDB Console",
66
"files": [

‎packages/web-console/src/utils/questdb.ts

+11-9
Original file line numberDiff line numberDiff line change
@@ -343,23 +343,25 @@ export class Client {
343343

344344
this._controllers.push(controller)
345345
let response: Response
346-
const start = new Date()
347346

348347
if (this.tokenNeedsRefresh() && !Client.refreshTokenPending) {
349348
await this.refreshAuthToken()
350349
}
351350

352-
await new Promise((resolve) => {
353-
const interval = setInterval(() => {
354-
if (!Client.refreshTokenPending) {
355-
clearInterval(interval)
356-
return resolve(true)
357-
}
358-
}, 100)
359-
})
351+
if (Client.refreshTokenPending) {
352+
await new Promise((resolve) => {
353+
const interval = setInterval(() => {
354+
if (!Client.refreshTokenPending) {
355+
clearInterval(interval)
356+
return resolve(true)
357+
}
358+
}, 100)
359+
})
360+
}
360361

361362
Client.numOfPendingQueries++
362363

364+
const start = new Date()
363365
try {
364366
response = await fetch(
365367
`${this._host}/exec?${Client.encodeParams(payload)}`,

0 commit comments

Comments
 (0)
Failed to load comments.