{"action":"created","issue":{"url":"https://api.github.com/repos/kelektiv/node-cron/issues/258","repository_url":"https://api.github.com/repos/kelektiv/node-cron","labels_url":"https://api.github.com/repos/kelektiv/node-cron/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/kelektiv/node-cron/issues/258/comments","events_url":"https://api.github.com/repos/kelektiv/node-cron/issues/258/events","html_url":"https://github.com/kelektiv/node-cron/issues/258","id":187249436,"number":258,"title":"How to avoid 2 tasks run parallel. ","user":{"login":"MaggieNgWu","id":23252160,"avatar_url":"https://avatars.githubusercontent.com/u/23252160?v=3","gravatar_id":"","url":"https://api.github.com/users/MaggieNgWu","html_url":"https://github.com/MaggieNgWu","followers_url":"https://api.github.com/users/MaggieNgWu/followers","following_url":"https://api.github.com/users/MaggieNgWu/following{/other_user}","gists_url":"https://api.github.com/users/MaggieNgWu/gists{/gist_id}","starred_url":"https://api.github.com/users/MaggieNgWu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaggieNgWu/subscriptions","organizations_url":"https://api.github.com/users/MaggieNgWu/orgs","repos_url":"https://api.github.com/users/MaggieNgWu/repos","events_url":"https://api.github.com/users/MaggieNgWu/events{/privacy}","received_events_url":"https://api.github.com/users/MaggieNgWu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-04T04:03:40Z","updated_at":"2016-11-04T04:08:14Z","closed_at":null,"body":"I would like to run 2 tasks with different cron-time, both these two tasks would connect database and modify data. But I would like to guarantee just one task is running at any time. What should I do?"},"comment":{"url":"https://api.github.com/repos/kelektiv/node-cron/issues/comments/258340754","html_url":"https://github.com/kelektiv/node-cron/issues/258#issuecomment-258340754","issue_url":"https://api.github.com/repos/kelektiv/node-cron/issues/258","id":258340754,"user":{"login":"MaggieNgWu","id":23252160,"avatar_url":"https://avatars.githubusercontent.com/u/23252160?v=3","gravatar_id":"","url":"https://api.github.com/users/MaggieNgWu","html_url":"https://github.com/MaggieNgWu","followers_url":"https://api.github.com/users/MaggieNgWu/followers","following_url":"https://api.github.com/users/MaggieNgWu/following{/other_user}","gists_url":"https://api.github.com/users/MaggieNgWu/gists{/gist_id}","starred_url":"https://api.github.com/users/MaggieNgWu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaggieNgWu/subscriptions","organizations_url":"https://api.github.com/users/MaggieNgWu/orgs","repos_url":"https://api.github.com/users/MaggieNgWu/repos","events_url":"https://api.github.com/users/MaggieNgWu/events{/privacy}","received_events_url":"https://api.github.com/users/MaggieNgWu/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T04:08:14Z","updated_at":"2016-11-04T04:08:14Z","body":"var task1=new CronJob('* * * * *',function(){\r\n     mongoose.connect(url);\r\n     doSomthing(function(){\r\n           mongoose.connection.close();\r\n     });   \r\n});\r\n\r\nvar task2=new CronJob('*/5 * * * *',function(){\r\n     mongoose.connect(url);\r\n     doSomthing(function(){\r\n           mongoose.connection.close();\r\n     });   \r\n});\r\n\r\nHow to avoid \"Try to open an unclosed connection\""}}
{"actor":{"display_login":"MaggieNgWu"}}