Skip to content

Commit 841a95b

Browse files
committed
fix lint
1 parent 3f6a83e commit 841a95b

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed
Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
1-
import worker_threads from "node:worker_threads";
2-
import { cpus } from "node:os";
3-
import url from "node:url";
4-
import path from "node:path";
5-
import uws from "uWebSockets.js";
1+
import worker_threads from 'node:worker_threads' // eslint-disable-line
2+
import { cpus } from 'node:os'
3+
import url from 'node:url'
4+
// import path from 'node:path'
5+
import uws from 'uWebSockets.js'
66

7-
var __filename = url.fileURLToPath(import.meta.url);
8-
var __dirname = path.dirname(__filename);
7+
const __filename = url.fileURLToPath(import.meta.url)
8+
// const __dirname = path.dirname(__filename)
99

10+
// eslint-disable-next-line
1011
if (worker_threads.isMainThread) {
1112
for (let i = cpus().length - 1; i >= 0; --i) {
12-
new worker_threads.Worker(__filename);
13+
// eslint-disable-next-line
14+
new worker_threads.Worker(__filename)
1315
}
1416
} else {
15-
const app = uws.App();
17+
const app = uws.App()
1618

1719
app
18-
.ws("/*", {
20+
.ws('/*', {
1921
compression: uws.DISABLED,
2022
maxPayloadLength: 512 * 1024 * 1024,
2123
maxBackpressure: 128 * 1024,
2224
idleTimeout: 60,
2325
message: (ws, message, isBinary) => {
2426
/* Here we echo the message back, using compression if available */
25-
const ok = ws.send(message, isBinary);
26-
},
27+
const ok = ws.send(message, isBinary) // eslint-disable-line
28+
}
2729
})
28-
.get("/*", (res, req) => {
30+
.get('/*', (res, req) => {
2931
/* It does Http as well */
3032
res
31-
.writeStatus("200 OK")
32-
.end("Hello there!");
33+
.writeStatus('200 OK')
34+
.end('Hello there!')
3335
})
3436
.listen(5001, (listenSocket) => {
3537
if (listenSocket) {
38+
// eslint-disable-next-line
3639
if (worker_threads.threadId === 0) {
37-
console.log("Listening to port 5001");
40+
console.log('Listening to port 5001')
3841
} else {
42+
// eslint-disable-next-line
3943
console.log(`Listening to port 5001 from thread ${worker_threads.threadId}`)
4044
}
4145
}
42-
});
46+
})
4347
}

0 commit comments

Comments
 (0)