From 73c9c7d79853930c4b8a2d96e238fe9c9ec97a11 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 28 Jun 2021 12:21:24 +0100 Subject: [PATCH] 10 seconds to deal with an event --- federationapi/routing/send.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 708ba38e..cb7d6ef9 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -498,6 +498,9 @@ func (t *txnReq) getServers(ctx context.Context, roomID string) []gomatrixserver } func (t *txnReq) processEvent(ctx context.Context, e *gomatrixserverlib.Event) error { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, time.Second*10) + defer cancel() logger := util.GetLogger(ctx).WithField("event_id", e.EventID()).WithField("room_id", e.RoomID()) t.work = "" // reset from previous event