Clean up feeds and listeners

This commit is contained in:
Jon Staab
2024-11-12 17:44:29 -08:00
parent 89a9d37379
commit 19ce6d1bad
8 changed files with 121 additions and 74 deletions
+3 -2
View File
@@ -268,7 +268,7 @@ export const setInboxRelayPolicy = (url: string, enabled: boolean) => {
export const checkRelayAccess = async (url: string, claim = "") => {
const connection = ctx.net.pool.get(url)
await connection.auth.attempt()
await connection.auth.attempt(5000)
const thunk = publishThunk({
event: createEvent(AUTH_JOIN, {tags: [["claim", claim]]}),
@@ -309,9 +309,10 @@ export const checkRelayAuth = async (url: string) => {
const connection = ctx.net.pool.get(url)
const okStatuses = [AuthStatus.None, AuthStatus.Ok]
await connection.auth.attempt()
await connection.auth.attempt(5000)
if (!okStatuses.includes(connection.auth.status)) {
console.log(connection.auth.status, connection)
return `Failed to authenticate: "${connection.auth.message}"`
}
}