summaryrefslogtreecommitdiff
path: root/internal/state.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-25 14:50:21 +0300
committerValery Piashchynski <[email protected]>2021-01-25 14:50:21 +0300
commitbb9e34db0f96295c5c2104262f43a3ab0edbc060 (patch)
treea9b0b99a36b796fdeaac130c9330de10aa4d5c0e /internal/state.go
parent709f7223fca5e60793ad9b3192f92a554854d6ee (diff)
Add new Supervisor test in the http plugin
Uniform supervisor config keys to use same notation as pool (10s, 10h not just 10)
Diffstat (limited to 'internal/state.go')
-rwxr-xr-xinternal/state.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/state.go b/internal/state.go
index 8f7d939b..a14a6937 100755
--- a/internal/state.go
+++ b/internal/state.go
@@ -13,7 +13,7 @@ type State interface {
// Set sets the WorkerState
Set(value int64)
// NumJobs shows how many times WorkerProcess was invoked
- NumExecs() int64
+ NumExecs() uint64
// IsActive returns true if WorkerProcess not Inactive or Stopped
IsActive() bool
// RegisterExec using to registering php executions
@@ -56,7 +56,7 @@ const (
type WorkerState struct {
value int64
- numExecs int64
+ numExecs uint64
// to be lightweight, use UnixNano
lastUsed uint64
}
@@ -87,8 +87,8 @@ func (s *WorkerState) String() string {
}
// NumExecs returns number of registered WorkerProcess execs.
-func (s *WorkerState) NumExecs() int64 {
- return atomic.LoadInt64(&s.numExecs)
+func (s *WorkerState) NumExecs() uint64 {
+ return atomic.LoadUint64(&s.numExecs)
}
// Value WorkerState returns WorkerState value
@@ -109,7 +109,7 @@ func (s *WorkerState) Set(value int64) {
// register new execution atomically
func (s *WorkerState) RegisterExec() {
- atomic.AddInt64(&s.numExecs, 1)
+ atomic.AddUint64(&s.numExecs, 1)
}
// Update last used time