diff --git a/actor/actor_context.go b/actor/actor_context.go index d1d20b72..55de5dc0 100644 --- a/actor/actor_context.go +++ b/actor/actor_context.go @@ -214,19 +214,15 @@ func (ctx *actorContext) Unwatch(who *PID) { } func (ctx *actorContext) SetReceiveTimeout(d time.Duration) { - if d <= 0 { - panic("Duration must be greater than zero") + if d < time.Millisecond { + // anything less than 1 millisecond is set to zero + d = 0 } if d == ctx.receiveTimeout { return } - if d < time.Millisecond { - // anything less than 1 millisecond is set to zero - d = 0 - } - ctx.receiveTimeout = d ctx.ensureExtras()