At 'active = false,' the script is still monitored for errors

Post Reply
jake
Posts: 444
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

At 'active = false,' the script is still monitored for errors

Post by jake » Saturday 30 June 2018 23:26

For a new script I always put the script inactive. But at 'active = false,' the script is still monitored for errors. This spams the log in a very high frequency.

It would be nice when this checking could be done in a third state: true, false, test (or debug)

dannybloe
Posts: 1473
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: At 'active = false,' the script is still monitored for errors

Post by dannybloe » Sunday 01 July 2018 8:28

Yes, I know what you mean but it can't be done. Lua loads all the scripts as a Lua module and at that moment it is parsed and evaluated as well. There is nothing I can do about that other than writing my own parsers in Lua and that makes everything horribly slow. So, there are two options: make sure that at least the code is syntacticly correct (the execute function isn't called so it doesn't have to be good code.. just syntactically correct). Or write your script in the GUI and un-tic the active switch there. Then the script isn't loaded by Lua (as it isn't on the filesystem). On top of that you have the advantage that the script is stored in the database and backed up along with the rest so you get some kind of versioning there as well.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest