mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
Merge pull request #2127 from PR0M3TH3AN/optimize-dm-decryptor-race-7712126730371272126
⚡ Optimize decryptLegacyDm with parallel execution
This commit is contained in:
1 file changed
+2
@@ -548,6 +548,8 @@ async function decryptLegacyDm(event, decryptors, actorPubkey) {
|
||||
}
|
||||
}
|
||||
|
||||
// Race all decryption attempts to return the first successful result
|
||||
// This significantly reduces latency compared to sequential attempts
|
||||
try {
|
||||
return await Promise.any(attempts);
|
||||
} catch (aggregateError) {
|
||||
|
||||
Reference in new issue
Block a user