Skip to content

Commit 970cd9e

Browse files
committed
make delayed event restart localTimeoutMs configurable
1 parent 7ef7ea7 commit 970cd9e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/client.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ export interface IStartClientOpts {
493493
*/
494494
pollTimeout?: number;
495495

496+
/**
497+
* The maximum amount of time to wait before timing out the `POST /_matrix/client/v1/delayed_events/{delay_id}` with `action = "restart"` requests.
498+
* If not specified, the default `localTimeoutMs` will be used.
499+
*/
500+
delayedEventRestartLocalTimeoutMS?: number;
501+
496502
/**
497503
* The filter to apply to /sync calls.
498504
*/
@@ -3478,8 +3484,12 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
34783484
const data = {
34793485
action,
34803486
};
3481-
return await this.http.authedRequest(Method.Post, path, undefined, data, {
3487+
const opts = {
3488+
localTimeoutMs: action === "restart" ? this.clientOpts?.delayedEventRestartLocalTimeoutMS : undefined,
34823489
...requestOptions,
3490+
};
3491+
return await this.http.authedRequest(Method.Post, path, undefined, data, {
3492+
...opts,
34833493
prefix: `${ClientPrefix.Unstable}/${UNSTABLE_MSC4140_DELAYED_EVENTS}`,
34843494
});
34853495
}

0 commit comments

Comments
 (0)