Fix logic to find available next number for limiters and queues. It fixes #3998
This commit is contained in:
parent
340ce958d9
commit
89cf3dc0b6
|
@ -4430,7 +4430,7 @@ function dnqueue_find_nextnumber() {
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($dnused as $dnnum) {
|
foreach ($dnused as $dnnum) {
|
||||||
if (($dnnum - $dnnumber) > 1) {
|
if (($dnnum - $dnnumber) > 1) {
|
||||||
$dnnumber = $dnnum + 1;
|
$dnnumber = $dnnum - 1;
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
|
@ -4456,7 +4456,7 @@ function dnpipe_find_nextnumber() {
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($dnused as $dnnum) {
|
foreach ($dnused as $dnnum) {
|
||||||
if (($dnnum - $dnnumber) > 1) {
|
if (($dnnum - $dnnumber) > 1) {
|
||||||
$dnnumber = $dnnum + 1;
|
$dnnumber = $dnnum - 1;
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
|
|
Reference in New Issue