Skip to content

Commit

Permalink
extend CmdList (see issue #153)
Browse files Browse the repository at this point in the history
  • Loading branch information
rg-engineering committed Jan 6, 2021
1 parent 1004c96 commit 0315388
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,13 @@ function GetUsedRooms() {
//
let alreadyChanging = false;
const ChangeStatusCmdList = [];
const MaxCmdList = 60;

async function ChangeStatus(state, room, value) {

if (alreadyChanging) {

if (ChangeStatusCmdList.length < 30) {
if (ChangeStatusCmdList.length < MaxCmdList) {

ChangeStatusCmdList.push(
{
Expand All @@ -259,7 +260,7 @@ async function ChangeStatus(state, room, value) {
parentAdapter.log.warn("ChangeStatus called, while already changing, push to list " + room + " " + state + " " + JSON.stringify(value) + " (" + ChangeStatusCmdList.length + ")");
}
else {
parentAdapter.log.error("ChangeStatusCmdList is longer then 30 entries, no new entry allowed -> skipped " + room + " " + state + " " + value);
parentAdapter.log.error("ChangeStatusCmdList is longer then " + MaxCmdList + " entries, no new entry allowed -> skipped " + room + " " + state + " " + value);
}
return;
}
Expand Down

0 comments on commit 0315388

Please sign in to comment.