Skip to content

Commit

Permalink
fix(onebot): fix incorrect gc, fix #227
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 14, 2021
1 parent a8bfe85 commit 2097fe8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/adapter-onebot/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ export function connect(bot: CQBot) {
const data = { action, params, echo: ++counter }
data.echo = ++counter
return new Promise((resolve, reject) => {
listeners[counter] = resolve
listeners[data.echo] = resolve
setTimeout(() => {
delete listeners[counter]
delete listeners[data.echo]
reject(new Error('response timeout'))
}, bot.app.options.onebot.responseTimeout)
bot.socket.send(JSON.stringify(data), (error) => {
Expand Down

0 comments on commit 2097fe8

Please sign in to comment.