diff options
author | Wolfy-J <[email protected]> | 2018-06-11 12:13:36 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-11 12:13:36 +0300 |
commit | efcddcc8d1b676c64cbd41a5f645bd046ba416d7 (patch) | |
tree | 8e51cde97920e62fcb03ad955933194d4af1b809 /state.go | |
parent | 4e54066384b1f2cfb6684c781976d3a9288f1f7e (diff) |
no more updated
Diffstat (limited to 'state.go')
-rw-r--r-- | state.go | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -3,7 +3,6 @@ package roadrunner import ( "fmt" "sync/atomic" - "time" ) // State represents worker status and updated time. @@ -15,9 +14,6 @@ type State interface { // NumJobs shows how many times worker was invoked NumExecs() int64 - - // Updated indicates a moment updated last state change - Updated() time.Time } const ( @@ -43,11 +39,10 @@ const ( type state struct { value int64 numExecs int64 - updated int64 } func newState(value int64) *state { - return &state{value: value, updated: time.Now().UnixNano()} + return &state{value: value} } // String returns current state as string. @@ -79,11 +74,6 @@ func (s *state) IsActive() bool { return state == StateWorking || state == StateReady } -// Updated indicates a moment updated last state change -func (s *state) Updated() time.Time { - return time.Unix(0, atomic.LoadInt64(&s.updated)) -} - func (s *state) NumExecs() int64 { return atomic.LoadInt64(&s.numExecs) } @@ -91,7 +81,6 @@ func (s *state) NumExecs() int64 { // change state value (status) func (s *state) set(value int64) { atomic.StoreInt64(&s.value, value) - atomic.StoreInt64(&s.updated, time.Now().UnixNano()) } // register new execution atomically |