mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-29 00:10:52 +00:00
Keep socket objects around so we can know their quality
This commit is contained in:
parent
66ab182640
commit
b9248c1cff
@ -7,6 +7,7 @@
|
||||
- [x] Add log in as user
|
||||
- [x] Add multi-account support
|
||||
- [x] Remove authors limit of 256
|
||||
- [x] Improve relay hints and selection
|
||||
|
||||
# 0.3.0
|
||||
|
||||
|
@ -95,7 +95,7 @@ setInterval(() => {
|
||||
// Prune connections we haven't used in a while
|
||||
for (const [url, socket] of Network.pool.data.entries()) {
|
||||
if (socket.meta.last_activity < now() - 60) {
|
||||
Network.pool.remove(url)
|
||||
Network.pool.get(url).disconnect()
|
||||
} else if (userRelays.has(url) && socket.meta.quality < 0.3) {
|
||||
$slowConnections.push(url)
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ export class Network {
|
||||
pool = new Pool()
|
||||
authHandler: (url: string, challenge: string) => void
|
||||
|
||||
relayIsLowQuality = (url: string) => this.pool.get(url, {autoConnect: false})?.meta?.quality < 0.5
|
||||
relayIsLowQuality = (url: string) => this.pool.get(url, {autoConnect: false})?.meta?.quality < 0.6
|
||||
|
||||
getExecutor = (urls: string[], {bypassBoot = false} = {}) => {
|
||||
if (this.engine.Env.FORCE_RELAYS?.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user