Lua script execution exceeds maximum number of lines

Moderator: leecollings

Post Reply
Filnet
Posts: 86
Joined: Tuesday 06 March 2018 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.1 ß
Location: FR
Contact:

Lua script execution exceeds maximum number of lines

Post by Filnet »

Hello,

I have two dzvents scripts which use the JSON module and run every minute.
If i enabled these two scripts (A and B), A works well but B get an error 'Lua script execution exceeds maximum number of lines'
If i disable A, B works well.
If A run "every 2 minutes" and B "every minute", B get an error only the same minute A is running.

The JSON module seems not purge data between the dzvents scripts running in the same minute.

Do you have an idea to solve this problem?
User avatar
jvdz
Posts: 2486
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Lua script execution exceeds maximum number of lines

Post by jvdz »

Without really seeing what you are doing with those 2 scripts, my bet would be that the 2 scripts together run longer than 10 seconds.
So when they each run for 6 seconds, they will only generate the error when both ran in the same batch.
So what exactly do these scripts do as you really should try to avoid any long wait times in the event system?
Filnet
Posts: 86
Joined: Tuesday 06 March 2018 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.1 ß
Location: FR
Contact:

Re: Lua script execution exceeds maximum number of lines

Post by Filnet »

Thank for your response,

I solved my problem:
Initially, I used requests via "os.execute". I now use asynchronous "executeShellCommand" calls. I have several such calls within the same script. The problem this creates is that the callbacks do not necessarily return in the same order in which the calls were made.
User avatar
waltervl
Posts: 7027
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Lua script execution exceeds maximum number of lines

Post by waltervl »

That is easy to solve by naming the callbacks differently, then you can trigger on them by name.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Filnet
Posts: 86
Joined: Tuesday 06 March 2018 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.1 ß
Location: FR
Contact:

Re: Lua script execution exceeds maximum number of lines

Post by Filnet »

That is already what I have done. However, each request queries a server (the same one), and I am not certain that it returns the responses in the order in which I requested them.

Thanks for your help.
Post Reply