Julian Bilcke
commited on
Commit
·
3399025
1
Parent(s):
c4480fd
remove query limitation
Browse files- src/index.mts +0 -12
src/index.mts
CHANGED
|
@@ -26,8 +26,6 @@ const timeoutInSec = 3 * 60
|
|
| 26 |
console.log("timeout set to 3 minutes")
|
| 27 |
|
| 28 |
app.use(express.static("public"))
|
| 29 |
-
|
| 30 |
-
const maxParallelRequests = 1
|
| 31 |
|
| 32 |
const pending: {
|
| 33 |
total: number;
|
|
@@ -62,16 +60,6 @@ app.get("/app", async (req, res) => {
|
|
| 62 |
res.end()
|
| 63 |
return
|
| 64 |
}
|
| 65 |
-
// naive implementation: we say we are out of capacity
|
| 66 |
-
if (pending.queue.length >= maxParallelRequests) {
|
| 67 |
-
res.write("sorry, max nb of parallel requests reached")
|
| 68 |
-
res.end()
|
| 69 |
-
return
|
| 70 |
-
}
|
| 71 |
-
// alternative approach: kill old queries
|
| 72 |
-
// while (pending.queue.length > maxParallelRequests) {
|
| 73 |
-
// endRequest(pending.queue[0], 'max nb of parallel request reached')
|
| 74 |
-
// }
|
| 75 |
|
| 76 |
const id = `${pending.total++}`
|
| 77 |
console.log(`new request ${id}`)
|
|
|
|
| 26 |
console.log("timeout set to 3 minutes")
|
| 27 |
|
| 28 |
app.use(express.static("public"))
|
|
|
|
|
|
|
| 29 |
|
| 30 |
const pending: {
|
| 31 |
total: number;
|
|
|
|
| 60 |
res.end()
|
| 61 |
return
|
| 62 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
const id = `${pending.total++}`
|
| 65 |
console.log(`new request ${id}`)
|