{"action":"created","comment":{"url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/comments/34862037","id":34862037,"diff_hunk":"@@ -448,6 +448,40 @@ DispatchRider.config do |config|\n   config.error_handler = DispatchRider::AirbrakeErrorHandler\n end\n ```\n+## Scheduling Job\n+\n+Scheduled jobs currently require `ActiveRecord`. Support for other ORM will be added in the future depending on demand.\n+\n+1. Add and run the DB migration below:\n+  ```ruby\n+  class CreateScheduledJobsTable < ActiveRecord::Migration\n+    include DispatchRider::ScheduledJob::Migration\n+\n+    def change\n+      create_scheduled_jobs_table\n+    end\n+  end\n+  ```\n+\n+2. Run publishing.\n+  ```ruby\n+  # Run once\n+\n+  # Ideally run on a cron. Where the cron is responsible for the publishing\n+  # frequency. Any jobs due at the time this is run by the cron  will be\n+  # published.\n+  DispatchRider::ScheduledJob.publish_due_jobs\n+\n+  # Loop. Warning: Loops are blocking. Run this on a separate thread if it's not\n+  # the sole purpose of the app.\n+\n+  # publish every minute\n+  DispatchRider::ScheduledJob.publish_due_jobs every: 1.minute\n+\n+  # publish every half an hour\n+  DispatchRider::ScheduledJob.publish_due_jobs every: 30.minutes\n+  ```\n+","path":"README.md","position":37,"original_position":37,"commit_id":"9306c3ad76611af586ca7092f0646362ff64feac","original_commit_id":"9120a4e14217104d65ca9ddd41af138bf66dfb93","user":{"login":"more-ron","id":194198,"avatar_url":"https://avatars.githubusercontent.com/u/194198?v=3","gravatar_id":"","url":"https://api.github.com/users/more-ron","html_url":"https://github.com/more-ron","followers_url":"https://api.github.com/users/more-ron/followers","following_url":"https://api.github.com/users/more-ron/following{/other_user}","gists_url":"https://api.github.com/users/more-ron/gists{/gist_id}","starred_url":"https://api.github.com/users/more-ron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/more-ron/subscriptions","organizations_url":"https://api.github.com/users/more-ron/orgs","repos_url":"https://api.github.com/users/more-ron/repos","events_url":"https://api.github.com/users/more-ron/events{/privacy}","received_events_url":"https://api.github.com/users/more-ron/received_events","type":"User","site_admin":false},"body":"Here's the PR for the ActiveJob support: https://github.com/payrollhero/activejob-dispatch_rider/pull/5","created_at":"2015-07-17T04:47:58Z","updated_at":"2015-07-17T04:47:58Z","html_url":"https://github.com/payrollhero/dispatch-rider/pull/68#discussion_r34862037","pull_request_url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/comments/34862037"},"html":{"href":"https://github.com/payrollhero/dispatch-rider/pull/68#discussion_r34862037"},"pull_request":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68","id":40196320,"html_url":"https://github.com/payrollhero/dispatch-rider/pull/68","diff_url":"https://github.com/payrollhero/dispatch-rider/pull/68.diff","patch_url":"https://github.com/payrollhero/dispatch-rider/pull/68.patch","issue_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/68","number":68,"state":"open","locked":false,"title":"Scheduled Job","user":{"login":"more-ron","id":194198,"avatar_url":"https://avatars.githubusercontent.com/u/194198?v=3","gravatar_id":"","url":"https://api.github.com/users/more-ron","html_url":"https://github.com/more-ron","followers_url":"https://api.github.com/users/more-ron/followers","following_url":"https://api.github.com/users/more-ron/following{/other_user}","gists_url":"https://api.github.com/users/more-ron/gists{/gist_id}","starred_url":"https://api.github.com/users/more-ron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/more-ron/subscriptions","organizations_url":"https://api.github.com/users/more-ron/orgs","repos_url":"https://api.github.com/users/more-ron/repos","events_url":"https://api.github.com/users/more-ron/events{/privacy}","received_events_url":"https://api.github.com/users/more-ron/received_events","type":"User","site_admin":false},"body":"**Feature:**\r\nThis will add support for scheduled jobs.\r\n\r\n**Ticket:**\r\nMainly for [MRR + ARPPU](https://app.asana.com/0/41592882922934/39842033097283) but could be used for precise data gathering time for [Analytics for lates](https://app.asana.com/0/41592882922934/36107421278586)\r\n\r\n**Submitter Checklist:**\r\n- [x] CI Passing\r\n- [x] PR Linked to Asana Ticket\r\n- [x] Hound Appeased Acceptably\r\n- [x] No Code Climate Issues\r\n- [x] Class, Module, and public method comments up to spec\r\n\r\n**Reviewer Checklist:**\r\n- [ ] New Code Tested Effectively\r\n- [ ] Code organization meets SOP standards\r\n- [ ] Does this code fulfill the ticket?\r\n\r\n**Only Then:**\r\n- [ ] Move ticket in Asana","created_at":"2015-07-17T02:50:49Z","updated_at":"2015-07-17T04:47:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1828b6bf084dd52a8f15a93c5606a1d23b040a2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68/commits","review_comments_url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68/comments","review_comment_url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/comments{/number}","comments_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/68/comments","statuses_url":"https://api.github.com/repos/payrollhero/dispatch-rider/statuses/9306c3ad76611af586ca7092f0646362ff64feac","head":{"label":"payrollhero:scheduled_job","ref":"scheduled_job","sha":"9306c3ad76611af586ca7092f0646362ff64feac","user":{"login":"payrollhero","id":1617662,"avatar_url":"https://avatars.githubusercontent.com/u/1617662?v=3","gravatar_id":"","url":"https://api.github.com/users/payrollhero","html_url":"https://github.com/payrollhero","followers_url":"https://api.github.com/users/payrollhero/followers","following_url":"https://api.github.com/users/payrollhero/following{/other_user}","gists_url":"https://api.github.com/users/payrollhero/gists{/gist_id}","starred_url":"https://api.github.com/users/payrollhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payrollhero/subscriptions","organizations_url":"https://api.github.com/users/payrollhero/orgs","repos_url":"https://api.github.com/users/payrollhero/repos","events_url":"https://api.github.com/users/payrollhero/events{/privacy}","received_events_url":"https://api.github.com/users/payrollhero/received_events","type":"Organization","site_admin":false},"repo":{"id":8812568,"name":"dispatch-rider","full_name":"payrollhero/dispatch-rider","owner":{"login":"payrollhero","id":1617662,"avatar_url":"https://avatars.githubusercontent.com/u/1617662?v=3","gravatar_id":"","url":"https://api.github.com/users/payrollhero","html_url":"https://github.com/payrollhero","followers_url":"https://api.github.com/users/payrollhero/followers","following_url":"https://api.github.com/users/payrollhero/following{/other_user}","gists_url":"https://api.github.com/users/payrollhero/gists{/gist_id}","starred_url":"https://api.github.com/users/payrollhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payrollhero/subscriptions","organizations_url":"https://api.github.com/users/payrollhero/orgs","repos_url":"https://api.github.com/users/payrollhero/repos","events_url":"https://api.github.com/users/payrollhero/events{/privacy}","received_events_url":"https://api.github.com/users/payrollhero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/payrollhero/dispatch-rider","description":"A messaging system (pub/sub).","fork":false,"url":"https://api.github.com/repos/payrollhero/dispatch-rider","forks_url":"https://api.github.com/repos/payrollhero/dispatch-rider/forks","keys_url":"https://api.github.com/repos/payrollhero/dispatch-rider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/payrollhero/dispatch-rider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/payrollhero/dispatch-rider/teams","hooks_url":"https://api.github.com/repos/payrollhero/dispatch-rider/hooks","issue_events_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/events{/number}","events_url":"https://api.github.com/repos/payrollhero/dispatch-rider/events","assignees_url":"https://api.github.com/repos/payrollhero/dispatch-rider/assignees{/user}","branches_url":"https://api.github.com/repos/payrollhero/dispatch-rider/branches{/branch}","tags_url":"https://api.github.com/repos/payrollhero/dispatch-rider/tags","blobs_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/refs{/sha}","trees_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/payrollhero/dispatch-rider/statuses/{sha}","languages_url":"https://api.github.com/repos/payrollhero/dispatch-rider/languages","stargazers_url":"https://api.github.com/repos/payrollhero/dispatch-rider/stargazers","contributors_url":"https://api.github.com/repos/payrollhero/dispatch-rider/contributors","subscribers_url":"https://api.github.com/repos/payrollhero/dispatch-rider/subscribers","subscription_url":"https://api.github.com/repos/payrollhero/dispatch-rider/subscription","commits_url":"https://api.github.com/repos/payrollhero/dispatch-rider/commits{/sha}","git_commits_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/commits{/sha}","comments_url":"https://api.github.com/repos/payrollhero/dispatch-rider/comments{/number}","issue_comment_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/comments{/number}","contents_url":"https://api.github.com/repos/payrollhero/dispatch-rider/contents/{+path}","compare_url":"https://api.github.com/repos/payrollhero/dispatch-rider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/payrollhero/dispatch-rider/merges","archive_url":"https://api.github.com/repos/payrollhero/dispatch-rider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/payrollhero/dispatch-rider/downloads","issues_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues{/number}","pulls_url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls{/number}","milestones_url":"https://api.github.com/repos/payrollhero/dispatch-rider/milestones{/number}","notifications_url":"https://api.github.com/repos/payrollhero/dispatch-rider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/payrollhero/dispatch-rider/labels{/name}","releases_url":"https://api.github.com/repos/payrollhero/dispatch-rider/releases{/id}","created_at":"2013-03-16T01:47:40Z","updated_at":"2015-04-15T00:39:45Z","pushed_at":"2015-07-17T04:21:08Z","git_url":"git://github.com/payrollhero/dispatch-rider.git","ssh_url":"git@github.com:payrollhero/dispatch-rider.git","clone_url":"https://github.com/payrollhero/dispatch-rider.git","svn_url":"https://github.com/payrollhero/dispatch-rider","homepage":"","size":1758,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"payrollhero:master","ref":"master","sha":"de2f71adc42175bd3cc423e4544a8c6a8a6e165f","user":{"login":"payrollhero","id":1617662,"avatar_url":"https://avatars.githubusercontent.com/u/1617662?v=3","gravatar_id":"","url":"https://api.github.com/users/payrollhero","html_url":"https://github.com/payrollhero","followers_url":"https://api.github.com/users/payrollhero/followers","following_url":"https://api.github.com/users/payrollhero/following{/other_user}","gists_url":"https://api.github.com/users/payrollhero/gists{/gist_id}","starred_url":"https://api.github.com/users/payrollhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payrollhero/subscriptions","organizations_url":"https://api.github.com/users/payrollhero/orgs","repos_url":"https://api.github.com/users/payrollhero/repos","events_url":"https://api.github.com/users/payrollhero/events{/privacy}","received_events_url":"https://api.github.com/users/payrollhero/received_events","type":"Organization","site_admin":false},"repo":{"id":8812568,"name":"dispatch-rider","full_name":"payrollhero/dispatch-rider","owner":{"login":"payrollhero","id":1617662,"avatar_url":"https://avatars.githubusercontent.com/u/1617662?v=3","gravatar_id":"","url":"https://api.github.com/users/payrollhero","html_url":"https://github.com/payrollhero","followers_url":"https://api.github.com/users/payrollhero/followers","following_url":"https://api.github.com/users/payrollhero/following{/other_user}","gists_url":"https://api.github.com/users/payrollhero/gists{/gist_id}","starred_url":"https://api.github.com/users/payrollhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payrollhero/subscriptions","organizations_url":"https://api.github.com/users/payrollhero/orgs","repos_url":"https://api.github.com/users/payrollhero/repos","events_url":"https://api.github.com/users/payrollhero/events{/privacy}","received_events_url":"https://api.github.com/users/payrollhero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/payrollhero/dispatch-rider","description":"A messaging system (pub/sub).","fork":false,"url":"https://api.github.com/repos/payrollhero/dispatch-rider","forks_url":"https://api.github.com/repos/payrollhero/dispatch-rider/forks","keys_url":"https://api.github.com/repos/payrollhero/dispatch-rider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/payrollhero/dispatch-rider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/payrollhero/dispatch-rider/teams","hooks_url":"https://api.github.com/repos/payrollhero/dispatch-rider/hooks","issue_events_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/events{/number}","events_url":"https://api.github.com/repos/payrollhero/dispatch-rider/events","assignees_url":"https://api.github.com/repos/payrollhero/dispatch-rider/assignees{/user}","branches_url":"https://api.github.com/repos/payrollhero/dispatch-rider/branches{/branch}","tags_url":"https://api.github.com/repos/payrollhero/dispatch-rider/tags","blobs_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/refs{/sha}","trees_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/payrollhero/dispatch-rider/statuses/{sha}","languages_url":"https://api.github.com/repos/payrollhero/dispatch-rider/languages","stargazers_url":"https://api.github.com/repos/payrollhero/dispatch-rider/stargazers","contributors_url":"https://api.github.com/repos/payrollhero/dispatch-rider/contributors","subscribers_url":"https://api.github.com/repos/payrollhero/dispatch-rider/subscribers","subscription_url":"https://api.github.com/repos/payrollhero/dispatch-rider/subscription","commits_url":"https://api.github.com/repos/payrollhero/dispatch-rider/commits{/sha}","git_commits_url":"https://api.github.com/repos/payrollhero/dispatch-rider/git/commits{/sha}","comments_url":"https://api.github.com/repos/payrollhero/dispatch-rider/comments{/number}","issue_comment_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/comments{/number}","contents_url":"https://api.github.com/repos/payrollhero/dispatch-rider/contents/{+path}","compare_url":"https://api.github.com/repos/payrollhero/dispatch-rider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/payrollhero/dispatch-rider/merges","archive_url":"https://api.github.com/repos/payrollhero/dispatch-rider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/payrollhero/dispatch-rider/downloads","issues_url":"https://api.github.com/repos/payrollhero/dispatch-rider/issues{/number}","pulls_url":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls{/number}","milestones_url":"https://api.github.com/repos/payrollhero/dispatch-rider/milestones{/number}","notifications_url":"https://api.github.com/repos/payrollhero/dispatch-rider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/payrollhero/dispatch-rider/labels{/name}","releases_url":"https://api.github.com/repos/payrollhero/dispatch-rider/releases{/id}","created_at":"2013-03-16T01:47:40Z","updated_at":"2015-04-15T00:39:45Z","pushed_at":"2015-07-17T04:21:08Z","git_url":"git://github.com/payrollhero/dispatch-rider.git","ssh_url":"git@github.com:payrollhero/dispatch-rider.git","clone_url":"https://github.com/payrollhero/dispatch-rider.git","svn_url":"https://github.com/payrollhero/dispatch-rider","homepage":"","size":1758,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68"},"html":{"href":"https://github.com/payrollhero/dispatch-rider/pull/68"},"issue":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/68"},"comments":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/payrollhero/dispatch-rider/statuses/9306c3ad76611af586ca7092f0646362ff64feac"}}}}