madmax3365 / node-red-node-discord

Discord nodes for node-red
6 stars 9 forks source link

exec node commands not being killed after payload is passed into it from discord get-msg node #11

Open Nagamakii opened 4 years ago

Nagamakii commented 4 years ago

I'm having an issue right now where when the msg.payload is passed from the get-msg node into an exec node it will run, but the pid won't go away and won't allow it to run anything other commands coming from the switch I have attached to the exec nodes. I tried setting a timeout on the exec node and it worked for the inject node but not the discord node. The weird thing is that it will work for a normal inject node with the exact same payload, but not with the discord get-msg node. I tried setting a timeout on the exec node and it worked for the inject node but not the discord node. I've been caught on this for a while and I don't know what to do next:( I appreciate any help

madmax3365 commented 4 years ago

Hey @Nagamakii. That's obviously strange behavior.
Can you provide what are you trying to execute through the exec node? And it would be great if you could share your node-red flow here.

Nagamakii commented 4 years ago

I unfortunately can't get the JSON text rn, but I was essentially running 2 consecutive commands (cd Documents && sudo python (the file is for a Pimoroni)) since the get-msg was only passing the msg.payload I used a switch to allow it to go to a different exec node, but the PID would not go away after the command had finished, and only allowed that specific command to be run. Timeouts oddly wouldn't kill the process as it did normally trough an inject node. The PID would simply just stay there until I deplyed the flow or reset something, however it would be able to display only the command that had be sent if you had run the command again