{"action":"closed","issue":{"url":"https://api.github.com/repos/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/issues/52","repository_url":"https://api.github.com/repos/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks","labels_url":"https://api.github.com/repos/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/issues/52/comments","events_url":"https://api.github.com/repos/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/issues/52/events","html_url":"https://github.com/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/issues/52","id":331055066,"node_id":"MDU6SXNzdWUzMzEwNTUwNjY=","number":52,"title":"Cannot read property 'insert' of undefined","user":{"login":"rapidmon17","id":4573368,"node_id":"MDQ6VXNlcjQ1NzMzNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/4573368?v=4","gravatar_id":"","url":"https://api.github.com/users/rapidmon17","html_url":"https://github.com/rapidmon17","followers_url":"https://api.github.com/users/rapidmon17/followers","following_url":"https://api.github.com/users/rapidmon17/following{/other_user}","gists_url":"https://api.github.com/users/rapidmon17/gists{/gist_id}","starred_url":"https://api.github.com/users/rapidmon17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapidmon17/subscriptions","organizations_url":"https://api.github.com/users/rapidmon17/orgs","repos_url":"https://api.github.com/users/rapidmon17/repos","events_url":"https://api.github.com/users/rapidmon17/events{/privacy}","received_events_url":"https://api.github.com/users/rapidmon17/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-11T06:01:00Z","updated_at":"2018-06-12T02:29:44Z","closed_at":"2018-06-12T02:29:43Z","author_association":"NONE","body":"For my first run, I copied and pasted the example in the docs.\r\nI created a file called worker.js with the following contents:\r\n\r\n```\r\nimport { Jobs } from 'meteor/msavin:sjobs';\r\n\r\n\r\n\r\nJobs.register({\r\n    \"sendReminder\": function (to, message) {\r\n        var call = HTTP.put(\"http://www.magic.com/sendEmail\", {\r\n            to: to,\r\n            message: message\r\n        })\r\n\r\n        if (call.statusCode === 200) {\r\n            this.success(call.result);\r\n        } else {\r\n            this.reschedule({\r\n                in: {\r\n                    minutes: 5\r\n                }\r\n            });\r\n        }\r\n    }\r\n});\r\n\r\n\r\nJobs.run(\"sendReminder\", \"jony@apple.com\", \"The future is here!\", {\r\n    in: {\r\n        days: 3,\r\n    }, \r\n    on: {\r\n        hour: 9,\r\n        minute: 42\r\n    },\r\n    priority: 9999999999\r\n});\r\n```\r\n\r\nAs a result my Meteor app is crashing with the following stacktrace:\r\n\r\n> W20180611-01:37:40.752(-4)? (STDERR) TypeError: Cannot read property 'insert' of undefined\r\n> W20180611-01:37:40.752(-4)? (STDERR)     at add (packages/msavin:sjobs/server/imports/actions/add/index.js:31:35)\r\n> W20180611-01:37:40.752(-4)? (STDERR)     at Object.Jobs.run (packages/msavin:sjobs/server/api.js:55:22)\r\n> W20180611-01:37:40.752(-4)? (STDERR)     at workers.js (imports/api/workers.js:25:6)\r\n> W20180611-01:37:40.752(-4)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)\r\n> W20180611-01:37:40.762(-4)? (STDERR)     at require (packages/modules-runtime.js:238:16)\r\n> W20180611-01:37:40.763(-4)? (STDERR)     at main.js (server/main.js:1:524)\r\n> W20180611-01:37:40.763(-4)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)\r\n> W20180611-01:37:40.763(-4)? (STDERR)     at require (packages/modules-runtime.js:238:16)\r\n> W20180611-01:37:40.764(-4)? (STDERR)     at /Users/rapidmon17/Projects/hello/.meteor/local/build/programs/server/app/app.js:1266:1\r\n> W20180611-01:37:40.764(-4)? (STDERR)     at /Users/rapidmon17/Projects/hello/.meteor/local/build/programs/server/boot.js:411:36\r\n> W20180611-01:37:40.764(-4)? (STDERR)     at Array.forEach (<anonymous>)\r\n> W20180611-01:37:40.764(-4)? (STDERR)     at /Users/rapidmon17/Projects/hello/.meteor/local/build/programs/server/boot.js:220:19\r\n> W20180611-01:37:40.764(-4)? (STDERR)     at /Users/rapidmon17/Projects/hello/.meteor/local/build/programs/server/boot.js:471:5\r\n> W20180611-01:37:40.764(-4)? (STDERR)     at Function.run (/Users/rapidmon17/Projects/hello/.meteor/local/build/programs/server/profile.js:510:12)\r\n> W20180611-01:37:40.764(-4)? (STDERR)     at /Users/rapidmon17/Projects/hello/.meteor/local/build/programs/server/boot.js:470:11"}}
{"actor":{"display_login":"rapidmon17"}}