Add alert kinds, minor tweaks, bump version

This commit is contained in:
Jon Staab
2025-06-30 10:52:03 -07:00
parent 1d6bd887ba
commit c54225380e
18 changed files with 42 additions and 31 deletions
+2 -2
View File
@@ -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)
}
+2 -2
View File
@@ -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