Skip to content

Commit

Permalink
Update dispatcher.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
simon300000 committed Sep 7, 2023
1 parent c288373 commit 9c1abe2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions api/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ export const receipt = (url: string, data: any) => {
return false
}

while (true) {
await wait(1000 * 10)
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 * 10)
const url = dispatch()
if (url) {
const res = await f(url)
const data = await res.json() as any
receipt(url, data)
}
}
}
})()

0 comments on commit 9c1abe2

Please sign in to comment.