From 1d092e57afb55a01283b41942ca3ef15a7e4bdef Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 18 Aug 2021 09:15:16 +0300 Subject: Update jobs stats tests Signed-off-by: Valery Piashchynski --- plugins/jobs/drivers/beanstalk/consumer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/jobs/drivers') diff --git a/plugins/jobs/drivers/beanstalk/consumer.go b/plugins/jobs/drivers/beanstalk/consumer.go index b4d76d38..6a178dff 100644 --- a/plugins/jobs/drivers/beanstalk/consumer.go +++ b/plugins/jobs/drivers/beanstalk/consumer.go @@ -240,14 +240,13 @@ func (j *JobConsumer) State(ctx context.Context) (*jobState.State, error) { // set stat, skip errors (replace with 0) // https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt#L523 if v, err := strconv.Atoi(stat["current-jobs-ready"]); err == nil { - // this is not an error, ready in terms of beanstalk means reserved in the tube - out.Reserved = int64(v) + out.Active = int64(v) } // https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt#L525 if v, err := strconv.Atoi(stat["current-jobs-reserved"]); err == nil { // this is not an error, reserved in beanstalk behaves like an active jobs - out.Active = int64(v) + out.Reserved = int64(v) } // https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt#L528 -- cgit v1.2.3