Project

General

Profile

« Previous | Next » 

Revision 8c460847

Added by François ARMAND over 6 years ago

Fixes #11330: Inventory endpoint info api is reporting saturated off by one

View differences:

inventory-provisioning-web/src/main/scala/com/normation/inventory/provisioning/endpoint/FusionReportEndpoint.scala
def queueInfo() = {
// get the current size, the remaining of the answer is based on that
val current = queueSize.get
val saturated = (current+1) >= maxQueueSize
//must be coherent with can do, current = 49 < max = 50 => not saturated
val saturated = current >= maxQueueSize
val code = if(saturated) HttpStatus.TOO_MANY_REQUESTS else HttpStatus.OK
val json = s"""{"queueMaxSize":$maxQueueSize, "queueFillCount":$current, "queueSaturated":$saturated}"""
val headers = new HttpHeaders()

Also available in: Unified diff