{"action":"created","issue":{"url":"https://api.github.com/repos/monteslu/node-red-contrib-gpio/issues/20","repository_url":"https://api.github.com/repos/monteslu/node-red-contrib-gpio","labels_url":"https://api.github.com/repos/monteslu/node-red-contrib-gpio/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/monteslu/node-red-contrib-gpio/issues/20/comments","events_url":"https://api.github.com/repos/monteslu/node-red-contrib-gpio/issues/20/events","html_url":"https://github.com/monteslu/node-red-contrib-gpio/issues/20","id":171305699,"number":20,"title":"Does a redeploy \"cleanup\" previous deploys?","user":{"login":"nkolban","id":3421732,"avatar_url":"https://avatars.githubusercontent.com/u/3421732?v=3","gravatar_id":"","url":"https://api.github.com/users/nkolban","html_url":"https://github.com/nkolban","followers_url":"https://api.github.com/users/nkolban/followers","following_url":"https://api.github.com/users/nkolban/following{/other_user}","gists_url":"https://api.github.com/users/nkolban/gists{/gist_id}","starred_url":"https://api.github.com/users/nkolban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkolban/subscriptions","organizations_url":"https://api.github.com/users/nkolban/orgs","repos_url":"https://api.github.com/users/nkolban/repos","events_url":"https://api.github.com/users/nkolban/events{/privacy}","received_events_url":"https://api.github.com/users/nkolban/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-16T02:10:44Z","updated_at":"2016-08-16T13:37:49Z","closed_at":null,"body":"I am using Node-RED 0.14.6 with Node.js 4.4.7.  When I deploy a flow that contains a \"Johnny5\" node, all works well.  If I change my logic and re-deploy, it is as though the previous deployment is still active concurrently with the new deployment.  Does a redeployment cause the \"cleanup\" of previous deployments?  When I stop Node-RED and restart it, all works again as desired until the next redeploy."},"comment":{"url":"https://api.github.com/repos/monteslu/node-red-contrib-gpio/issues/comments/240103917","html_url":"https://github.com/monteslu/node-red-contrib-gpio/issues/20#issuecomment-240103917","issue_url":"https://api.github.com/repos/monteslu/node-red-contrib-gpio/issues/20","id":240103917,"user":{"login":"monteslu","id":423800,"avatar_url":"https://avatars.githubusercontent.com/u/423800?v=3","gravatar_id":"","url":"https://api.github.com/users/monteslu","html_url":"https://github.com/monteslu","followers_url":"https://api.github.com/users/monteslu/followers","following_url":"https://api.github.com/users/monteslu/following{/other_user}","gists_url":"https://api.github.com/users/monteslu/gists{/gist_id}","starred_url":"https://api.github.com/users/monteslu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monteslu/subscriptions","organizations_url":"https://api.github.com/users/monteslu/orgs","repos_url":"https://api.github.com/users/monteslu/repos","events_url":"https://api.github.com/users/monteslu/events{/privacy}","received_events_url":"https://api.github.com/users/monteslu/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T13:37:48Z","updated_at":"2016-08-16T13:37:48Z","body":"So, there's quite a bit of hackery in this...\r\n\r\nFor pagenodes I can run johnny-five in a webworker and just dump the webworker on redeploy:  https://github.com/monteslu/pagenodes/blob/master/src/red/nodes/nodeDefs/io/lib/nodebotNode.js#L168  Works like a champ.\r\n\r\nFor node-red i have to try and clean up after myself since the same javascript VM persists.  What this means is that I try clearing intervals and disconnecting things:  https://github.com/monteslu/node-red-contrib-gpio/blob/master/lib/nodebotNode.js#L43-L99\r\n\r\nThe problem with my node-red method of cleaning up is I might be leaving stuff out there that my own testing hasn't noticed.\r\n\r\nI cant try and reproduce your specific error if you want to share some code from the johnny5 node you're deploying.\r\n\r\nA better long term solution might be to use node's clustering mechanism to spawn a thread for each connected nodebot.  I need to investing this some more.\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"monteslu"}}