mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-08-29 07:27:16 +00:00
perf: optimize bridge outbox sweep during idle states
This commit is contained in:
parent
1f59e814f9
commit
04ab61cf6f
@ -103,11 +103,12 @@ final class MessageRouter {
|
||||
bridgeSweepTask = Task { @MainActor [weak self] in
|
||||
while !Task.isCancelled {
|
||||
try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
|
||||
guard let self = self, !self.outbox.isEmpty else { continue }
|
||||
// Expire stale outbox entries in-session too — otherwise a DM
|
||||
// to a peer that never reconnects sits on "sending" until the
|
||||
// next relaunch instead of surfacing as failed.
|
||||
self?.cleanupExpiredMessages()
|
||||
self?.retryBridgeCourierDeposits()
|
||||
self.cleanupExpiredMessages()
|
||||
self.retryBridgeCourierDeposits()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user