diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 44af88b1f..35a611ee0 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -368,7 +368,10 @@ func (t *inputWorker) run() { return default: evStart := time.Now() - task.err = task.t.processEvent(task.ctx, task.event) + // TODO: Is 5 minutes too long? + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5) + task.err = task.t.processEvent(ctx, task.event) + cancel() task.duration = time.Since(evStart) if err := task.err; err != nil { switch err.(type) {