Add alert kinds, minor tweaks, bump version
This commit is contained in:
@@ -98,7 +98,7 @@ export const socketPolicyConnectOnSend = (socket: Socket) => {
|
||||
const isClosed = [SocketStatus.Closed, SocketStatus.Error].includes(socket.status)
|
||||
|
||||
// When a new message is sent, make sure the socket is open (unless there was a recent error)
|
||||
if (isClosed && lastError < ago(10)) {
|
||||
if (isClosed && lastError < ago(5)) {
|
||||
socket.open()
|
||||
}
|
||||
}),
|
||||
@@ -157,7 +157,7 @@ export const socketPolicyReopenActive = (socket: Socket) => {
|
||||
|
||||
// If the socket closed and we have no error, reopen it but don't flap
|
||||
if (isClosed && pending.size) {
|
||||
sleep(Math.max(0, 10_000 - (Date.now() - lastOpen))).then(() => {
|
||||
sleep(Math.max(0, 5000 - (Date.now() - lastOpen))).then(() => {
|
||||
for (const message of pending.values()) {
|
||||
socket.send(message)
|
||||
}
|
||||
|
||||
@@ -169,9 +169,9 @@ export type RequestOptions = BaseRequestOptions & {
|
||||
|
||||
export const request = async (options: RequestOptions) => {
|
||||
const closed = new Set<string>()
|
||||
const tracker = new Tracker()
|
||||
const relays = new Set(options.relays)
|
||||
const ctrl = new AbortController()
|
||||
const relays = new Set(options.relays)
|
||||
const tracker = options.tracker || new Tracker()
|
||||
const signal = options.signal ? AbortSignal.any([options.signal, ctrl.signal]) : ctrl.signal
|
||||
const threshold = options.threshold || 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user