mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 17:23:09 -06:00
Keep goroutine count down by not starting work for things where the caller gave up
This commit is contained in:
parent
c1655736dd
commit
59b1df09e5
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue