Refactor
This commit is contained in:
17
server/timer.go
Normal file
17
server/timer.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func (server *Server) stopTimer() {
|
||||
if server.options.Timeout > 0 {
|
||||
server.timer.Stop()
|
||||
}
|
||||
}
|
||||
|
||||
func (server *Server) resetTimer() {
|
||||
if server.options.Timeout > 0 {
|
||||
server.timer.Reset(time.Duration(server.options.Timeout) * time.Second)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user