Browse Source

Cleanup

pull/1842/head
Ethan Frey 7 years ago
parent
commit
4ec7883891
1 changed files with 1 additions and 5 deletions
  1. +1
    -5
      common/throttle_timer.go

+ 1
- 5
common/throttle_timer.go View File

@ -1,7 +1,6 @@
package common package common
import ( import (
"fmt"
"time" "time"
) )
@ -64,7 +63,6 @@ func (t *ThrottleTimer) run() {
// happen in this method. It is only called from the run goroutine // happen in this method. It is only called from the run goroutine
// so we avoid any race conditions // so we avoid any race conditions
func (t *ThrottleTimer) processInput(cmd command) (shutdown bool) { func (t *ThrottleTimer) processInput(cmd command) (shutdown bool) {
fmt.Printf("processInput: %d\n", cmd)
switch cmd { switch cmd {
case Set: case Set:
if !t.isSet { if !t.isSet {
@ -77,9 +75,7 @@ func (t *ThrottleTimer) processInput(cmd command) (shutdown bool) {
case Unset: case Unset:
if t.isSet { if t.isSet {
t.isSet = false t.isSet = false
if !t.timer.Stop() {
<-t.timer.C
}
t.timer.Stop()
} }
default: default:
panic("unknown command!") panic("unknown command!")


Loading…
Cancel
Save