Page MenuHomePhabricator

D11376.diff
No OneTemporary

D11376.diff

diff --git a/keyserver/src/socket/tunnelbroker-socket.js b/keyserver/src/socket/tunnelbroker-socket.js
--- a/keyserver/src/socket/tunnelbroker-socket.js
+++ b/keyserver/src/socket/tunnelbroker-socket.js
@@ -1,5 +1,6 @@
// @flow
+import _debounce from 'lodash/debounce.js';
import uuid from 'uuid';
import WebSocket from 'ws';
@@ -109,7 +110,7 @@
const messageToKeyserver = JSON.parse(payload);
if (refreshKeysRequestValidator.is(messageToKeyserver)) {
const request: RefreshKeyRequest = messageToKeyserver;
- this.refreshOneTimeKeys(request.numberOfKeys);
+ this.debouncedRefreshOneTimeKeys(request.numberOfKeys);
}
} catch (e) {
console.error(
@@ -159,6 +160,12 @@
})();
};
+ debouncedRefreshOneTimeKeys: (numberOfKeys: number) => void = _debounce(
+ this.refreshOneTimeKeys,
+ 100,
+ { leading: true, trailing: true },
+ );
+
sendMessage: (message: ClientMessageToDevice) => Promise<void> = (
message: ClientMessageToDevice,
) => {

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 9:29 PM (21 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581020
Default Alt Text
D11376.diff (1 KB)

Event Timeline