mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Convert promise to callback.
This commit is contained in:
parent
f5eb2d0237
commit
b04f499355
@ -61,6 +61,8 @@ async function doRequest(params: OptionsWithUri): Promise<{response: RequestResp
|
||||
* agent to achieve more performance.
|
||||
*/
|
||||
export function installRequestFunction() {
|
||||
// Keep connections alive for long enough to be reused.
|
||||
setRequestFn(doRequest);
|
||||
setRequestFn(
|
||||
(params: OptionsWithUri, callback: (err: Error|null, response?: unknown, rBody?: unknown) => void) =>
|
||||
doRequest(params).then(({response, rBody}) => callback(null, response, rBody)).catch(callback)
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user