Skip to content

Commit

Permalink
Removed expiresIn for WebSocket and other small corrections, touch #456.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulDalek committed Jun 24, 2024
1 parent e044382 commit f5eb3a7
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 53 deletions.
4 changes: 2 additions & 2 deletions dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.esm.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,15 @@ export const postWork = async (chart, options) => {
log(
5,
options.payload?.requestId
? `[benchmark] Request with ID ${options.payload?.requestId} -`
? `[benchmark] Request: ${options.payload?.requestId} -`
: '[benchmark]',
`Acquired a worker handle: ${acquireCounter()}ms.`
);
}
} catch (error) {
throw new ExportError(
(options.payload?.requestId
? `For request with ID ${options.payload?.requestId} - `
? `Request: ${options.payload?.requestId} - `
: '') +
`Error encountered when acquiring an available entry: ${acquireCounter()}ms.`
).setError(error);
Expand Down Expand Up @@ -316,7 +316,7 @@ export const postWork = async (chart, options) => {

throw new ExportError(
(options.payload?.requestId
? `For request with ID ${options.payload?.requestId} - `
? `Request: ${options.payload?.requestId} - `
: '') + `Error encountered during export: ${exportCounter()}ms.`
).setError(result);
}
Expand All @@ -326,7 +326,7 @@ export const postWork = async (chart, options) => {
log(
5,
options.payload?.requestId
? `[benchmark] Request with ID ${options.payload?.requestId} -`
? `[benchmark] Request: ${options.payload?.requestId} -`
: '[benchmark]',
`Exported a chart sucessfully: ${exportCounter()}ms.`
);
Expand Down
2 changes: 1 addition & 1 deletion lib/server/routes/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const exportHandler = async (request, response, next) => {
if (defaultOptions.server.benchmarking) {
log(
5,
`[benchmark] Request with ID ${uniqueId} - After the whole exporting process: ${stopCounter()}ms.`
`[benchmark] Request: ${uniqueId} - After the whole exporting process: ${stopCounter()}ms.`
);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/server/web_socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export function init(address) {
headers: {
// Set an access token that lasts only 5 minutes
auth: jwt.sign({ success: 'success' }, webSocketOptions.secret, {
algorithm: 'HS256',
expiresIn: '5m'
algorithm: 'HS256'
}),
// Send the server address in a custom header
'X-Server-Address': `${address.protocol}://${
Expand Down
82 changes: 44 additions & 38 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
"dependencies": {
"colors": "1.4.0",
"cors": "^2.8.5",
"dompurify": "^3.1.4",
"dompurify": "^3.1.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express-rate-limit": "^7.3.1",
"https-proxy-agent": "^7.0.4",
"jsdom": "^24.0.0",
"jsdom": "^24.1.0",
"jsonwebtoken": "^9.0.2",
"multer": "^1.4.5-lts.1",
"prompts": "^2.4.2",
"puppeteer": "^22.11.2",
"puppeteer": "^22.12.0",
"tarn": "^3.0.2",
"uuid": "^10.0.0",
"ws": "^8.17.1",
Expand All @@ -67,7 +67,7 @@
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": "^15.2.7",
"nodemon": "^3.1.3",
"nodemon": "^3.1.4",
"prettier": "^3.3.2",
"rollup": "^4.18.0"
}
Expand Down

0 comments on commit f5eb3a7

Please sign in to comment.