Skip to content

Commit

Permalink
dispatch 30 parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
simon300000 committed Sep 7, 2023
1 parent c75dbb1 commit eb28917
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions api/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,22 @@ export const receipt = (url: string, data: any) => {
return false
}

const down = async () => {
const url = dispatch()
if (url) {
const res = await f(url)
const data = await res.json() as any
receipt(url, data)
}
}

;

(async () => {
while (true) {
await wait(1000 * 30)
const url = dispatch()
if (url) {
const res = await f(url)
const data = await res.json() as any
receipt(url, data)
for (let index = 0; index < 30; index++) {
down()
}
}
})()

0 comments on commit eb28917

Please sign in to comment.