diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-07-28 23:32:31 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-07-28 23:32:31 (GMT) |
commit | 6318f15059d09fc6c786a479383d53c971e27c2c (patch) | |
tree | e78fd3b77caf9c5eeda5cc0547d27ebb3a0041cc | |
parent | 3d531954d12cbc09a8791581b1911e6e39d86203 (diff) |
don't allow unlimited sessions
-rw-r--r-- | rhimport/session.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rhimport/session.go b/rhimport/session.go index e749020..39c02a4 100644 --- a/rhimport/session.go +++ b/rhimport/session.go @@ -144,8 +144,8 @@ func (s *session) run(timeout time.Duration) { s.ctx.Cancel = s.cancelIntChan go sessionRun(s.ctx, s.doneIntChan) s.state = _SESSION_RUNNING - if timeout > 3*time.Hour { - s.ctx.stdlog.Printf("requested session timeout (%v) is to high - lowering to 3h", timeout) + if timeout <= 0 || timeout > 3*time.Hour { + s.ctx.stdlog.Printf("requested session timeout (%v) is invalid or too high - setting it to 3h", timeout) timeout = 3 * time.Hour } s.timer.Reset(timeout) |