commit
3fb67e87b5
1 changed files with 15 additions and 4 deletions
|
|
@ -169,10 +169,21 @@ export default class Handler {
|
||||||
}
|
}
|
||||||
|
|
||||||
const signed = finishEvent(toSign, appInfo.privateKey)
|
const signed = finishEvent(toSign, appInfo.privateKey)
|
||||||
this.pool.publish(relays || this.settings.relays, signed).forEach(p => {
|
let sent = false
|
||||||
p.then(() => console.log("sent ok"))
|
const log = getLogger({ appName: appInfo.name })
|
||||||
p.catch(() => console.log("failed to send"))
|
await Promise.all(this.pool.publish(relays || this.settings.relays, signed).map(async p => {
|
||||||
})
|
try {
|
||||||
|
await p
|
||||||
|
sent = true
|
||||||
|
} catch (e: any) {
|
||||||
|
log(e)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
if (!sent) {
|
||||||
|
log("failed to send event")
|
||||||
|
} else {
|
||||||
|
log("event sent ok")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetAppKeys(appInfo: Partial<AppInfo>) {
|
GetAppKeys(appInfo: Partial<AppInfo>) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue