{"action":"created","issue":{"url":"https://api.github.com/repos/peerlibrary/meteor-classy-job/issues/3","repository_url":"https://api.github.com/repos/peerlibrary/meteor-classy-job","labels_url":"https://api.github.com/repos/peerlibrary/meteor-classy-job/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/peerlibrary/meteor-classy-job/issues/3/comments","events_url":"https://api.github.com/repos/peerlibrary/meteor-classy-job/issues/3/events","html_url":"https://github.com/peerlibrary/meteor-classy-job/issues/3","id":177821509,"number":3,"title":"API to cancel recurring jobs potentially missing (or underexplained)?","user":{"login":"CdavM","id":5568048,"avatar_url":"https://avatars.githubusercontent.com/u/5568048?v=3","gravatar_id":"","url":"https://api.github.com/users/CdavM","html_url":"https://github.com/CdavM","followers_url":"https://api.github.com/users/CdavM/followers","following_url":"https://api.github.com/users/CdavM/following{/other_user}","gists_url":"https://api.github.com/users/CdavM/gists{/gist_id}","starred_url":"https://api.github.com/users/CdavM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CdavM/subscriptions","organizations_url":"https://api.github.com/users/CdavM/orgs","repos_url":"https://api.github.com/users/CdavM/repos","events_url":"https://api.github.com/users/CdavM/events{/privacy}","received_events_url":"https://api.github.com/users/CdavM/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-19T15:46:52Z","updated_at":"2016-09-19T17:23:43Z","closed_at":null,"body":"I am trying to cancel a job that is scheduled to repeat forever with a certain wait parameter. \r\n\r\nI am currently doing this via:\r\n\r\nschedule:\r\n`new ExampleJob({name: \"Foo\"}).enqueue({repeat: {wait:500}});`\r\n\r\ncancel:\r\n`JobsWorker.collection.remove({\"data.name\": \"Foo\"})`\r\n\r\nBut this may not be the best way to achieve this. Could you advise on how to cancel an existing job?\r\n\r\nI see that meteor-job-collection package has a method called getJob, so I can do something like getJob({\"data.name\": \"Foo\"}).cancel() or .remove()."},"comment":{"url":"https://api.github.com/repos/peerlibrary/meteor-classy-job/issues/comments/248059764","html_url":"https://github.com/peerlibrary/meteor-classy-job/issues/3#issuecomment-248059764","issue_url":"https://api.github.com/repos/peerlibrary/meteor-classy-job/issues/3","id":248059764,"user":{"login":"mitar","id":585279,"avatar_url":"https://avatars.githubusercontent.com/u/585279?v=3","gravatar_id":"","url":"https://api.github.com/users/mitar","html_url":"https://github.com/mitar","followers_url":"https://api.github.com/users/mitar/followers","following_url":"https://api.github.com/users/mitar/following{/other_user}","gists_url":"https://api.github.com/users/mitar/gists{/gist_id}","starred_url":"https://api.github.com/users/mitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitar/subscriptions","organizations_url":"https://api.github.com/users/mitar/orgs","repos_url":"https://api.github.com/users/mitar/repos","events_url":"https://api.github.com/users/mitar/events{/privacy}","received_events_url":"https://api.github.com/users/mitar/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T17:23:43Z","updated_at":"2016-09-19T17:23:43Z","body":"So to schedule repeated jobs I often use:\r\n\r\n```\r\nnew ExampleJob({name: \"Foo\"}).enqueue({repeat: {wait:500}, skipIfExisting: true});\r\n```\r\n\r\nThis assures that I do not schedule multiple repeated jobs at the same time.\r\n\r\nYes, removal from the database directly is not a good idea because you lost state information."}}
{"actor":{"display_login":"mitar"}}