{"action":"created","comment":{"url":"https://api.github.com/repos/ui/rq-scheduler/pulls/comments/37043638","id":37043638,"diff_hunk":"@@ -11,3 +13,9 @@ def from_unix(string):\n def to_unix(dt):\n     \"\"\"Converts a datetime object to unixtime\"\"\"\n     return calendar.timegm(dt.utctimetuple())\n+\n+def crontab_get_next_scheduled_time(crontab_string):","path":"rq_scheduler/utils.py","position":12,"original_position":12,"commit_id":"305098986edf661db378d0ed9c04508c4d88953f","original_commit_id":"305098986edf661db378d0ed9c04508c4d88953f","user":{"login":"selwin","id":188658,"avatar_url":"https://avatars.githubusercontent.com/u/188658?v=3","gravatar_id":"","url":"https://api.github.com/users/selwin","html_url":"https://github.com/selwin","followers_url":"https://api.github.com/users/selwin/followers","following_url":"https://api.github.com/users/selwin/following{/other_user}","gists_url":"https://api.github.com/users/selwin/gists{/gist_id}","starred_url":"https://api.github.com/users/selwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selwin/subscriptions","organizations_url":"https://api.github.com/users/selwin/orgs","repos_url":"https://api.github.com/users/selwin/repos","events_url":"https://api.github.com/users/selwin/events{/privacy}","received_events_url":"https://api.github.com/users/selwin/received_events","type":"User","site_admin":false},"body":"Can we rename the function signature to `get_next_scheduled_time(crontab_string)`?","created_at":"2015-08-14T01:35:17Z","updated_at":"2015-08-14T01:35:17Z","html_url":"https://github.com/ui/rq-scheduler/pull/80#discussion_r37043638","pull_request_url":"https://api.github.com/repos/ui/rq-scheduler/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/ui/rq-scheduler/pulls/comments/37043638"},"html":{"href":"https://github.com/ui/rq-scheduler/pull/80#discussion_r37043638"},"pull_request":{"href":"https://api.github.com/repos/ui/rq-scheduler/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/ui/rq-scheduler/pulls/80","id":37334538,"html_url":"https://github.com/ui/rq-scheduler/pull/80","diff_url":"https://github.com/ui/rq-scheduler/pull/80.diff","patch_url":"https://github.com/ui/rq-scheduler/pull/80.patch","issue_url":"https://api.github.com/repos/ui/rq-scheduler/issues/80","number":80,"state":"open","locked":false,"title":"Add crontab functionality to scheduler","user":{"login":"petervtzand","id":1419427,"avatar_url":"https://avatars.githubusercontent.com/u/1419427?v=3","gravatar_id":"","url":"https://api.github.com/users/petervtzand","html_url":"https://github.com/petervtzand","followers_url":"https://api.github.com/users/petervtzand/followers","following_url":"https://api.github.com/users/petervtzand/following{/other_user}","gists_url":"https://api.github.com/users/petervtzand/gists{/gist_id}","starred_url":"https://api.github.com/users/petervtzand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petervtzand/subscriptions","organizations_url":"https://api.github.com/users/petervtzand/orgs","repos_url":"https://api.github.com/users/petervtzand/repos","events_url":"https://api.github.com/users/petervtzand/events{/privacy}","received_events_url":"https://api.github.com/users/petervtzand/received_events","type":"User","site_admin":false},"body":"Added crontab functionality to the scheduler function:\r\n- give a crontab string (http://en.wikipedia.org/wiki/Cron) instead of a datetime object for `scheduled_time`\r\n- optional: give a start time ( so look for first scheduled time after this date)\r\n- it will calculate the scheduled time when job is created\r\n- it will calculate a new scheduled time when its rescheduled\r\n\r\nThere are still 2 todo's (tests). I will fix them if this PR will be reviewed.\r\n\r\n# Checklist\r\n- [x] Write functionality for crontab\r\n  - [x] Find a way to get the argument in the schedule function\r\n  - [x] Calculate `scheduled_time` using `croniter`\r\n  - [x] Calculate `scheduled_time` when rescheduling using `croniter`\r\n- [x] Write tests\r\n  - [x] Check that we can create a job with a crontab string\r\n  - [x] Check that the scheduled time is calculated correctly\r\n  - [x] Check that the job is rescheduled after the first job has run (how?)\r\n","created_at":"2015-06-10T08:23:53Z","updated_at":"2015-08-14T01:35:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a629d63b705a2db58cb594b74e2d19e045356563","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ui/rq-scheduler/pulls/80/commits","review_comments_url":"https://api.github.com/repos/ui/rq-scheduler/pulls/80/comments","review_comment_url":"https://api.github.com/repos/ui/rq-scheduler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ui/rq-scheduler/issues/80/comments","statuses_url":"https://api.github.com/repos/ui/rq-scheduler/statuses/305098986edf661db378d0ed9c04508c4d88953f","head":{"label":"petervtzand:add-crontab-functionality-to-scheduler","ref":"add-crontab-functionality-to-scheduler","sha":"305098986edf661db378d0ed9c04508c4d88953f","user":{"login":"petervtzand","id":1419427,"avatar_url":"https://avatars.githubusercontent.com/u/1419427?v=3","gravatar_id":"","url":"https://api.github.com/users/petervtzand","html_url":"https://github.com/petervtzand","followers_url":"https://api.github.com/users/petervtzand/followers","following_url":"https://api.github.com/users/petervtzand/following{/other_user}","gists_url":"https://api.github.com/users/petervtzand/gists{/gist_id}","starred_url":"https://api.github.com/users/petervtzand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petervtzand/subscriptions","organizations_url":"https://api.github.com/users/petervtzand/orgs","repos_url":"https://api.github.com/users/petervtzand/repos","events_url":"https://api.github.com/users/petervtzand/events{/privacy}","received_events_url":"https://api.github.com/users/petervtzand/received_events","type":"User","site_admin":false},"repo":{"id":37136264,"name":"rq-scheduler","full_name":"petervtzand/rq-scheduler","owner":{"login":"petervtzand","id":1419427,"avatar_url":"https://avatars.githubusercontent.com/u/1419427?v=3","gravatar_id":"","url":"https://api.github.com/users/petervtzand","html_url":"https://github.com/petervtzand","followers_url":"https://api.github.com/users/petervtzand/followers","following_url":"https://api.github.com/users/petervtzand/following{/other_user}","gists_url":"https://api.github.com/users/petervtzand/gists{/gist_id}","starred_url":"https://api.github.com/users/petervtzand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petervtzand/subscriptions","organizations_url":"https://api.github.com/users/petervtzand/orgs","repos_url":"https://api.github.com/users/petervtzand/repos","events_url":"https://api.github.com/users/petervtzand/events{/privacy}","received_events_url":"https://api.github.com/users/petervtzand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/petervtzand/rq-scheduler","description":"A light library that adds job scheduling capabilities to RQ (Redis Queue)","fork":true,"url":"https://api.github.com/repos/petervtzand/rq-scheduler","forks_url":"https://api.github.com/repos/petervtzand/rq-scheduler/forks","keys_url":"https://api.github.com/repos/petervtzand/rq-scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petervtzand/rq-scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petervtzand/rq-scheduler/teams","hooks_url":"https://api.github.com/repos/petervtzand/rq-scheduler/hooks","issue_events_url":"https://api.github.com/repos/petervtzand/rq-scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/petervtzand/rq-scheduler/events","assignees_url":"https://api.github.com/repos/petervtzand/rq-scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/petervtzand/rq-scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/petervtzand/rq-scheduler/tags","blobs_url":"https://api.github.com/repos/petervtzand/rq-scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petervtzand/rq-scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petervtzand/rq-scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/petervtzand/rq-scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petervtzand/rq-scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/petervtzand/rq-scheduler/languages","stargazers_url":"https://api.github.com/repos/petervtzand/rq-scheduler/stargazers","contributors_url":"https://api.github.com/repos/petervtzand/rq-scheduler/contributors","subscribers_url":"https://api.github.com/repos/petervtzand/rq-scheduler/subscribers","subscription_url":"https://api.github.com/repos/petervtzand/rq-scheduler/subscription","commits_url":"https://api.github.com/repos/petervtzand/rq-scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/petervtzand/rq-scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/petervtzand/rq-scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/petervtzand/rq-scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/petervtzand/rq-scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/petervtzand/rq-scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petervtzand/rq-scheduler/merges","archive_url":"https://api.github.com/repos/petervtzand/rq-scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petervtzand/rq-scheduler/downloads","issues_url":"https://api.github.com/repos/petervtzand/rq-scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/petervtzand/rq-scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/petervtzand/rq-scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/petervtzand/rq-scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petervtzand/rq-scheduler/labels{/name}","releases_url":"https://api.github.com/repos/petervtzand/rq-scheduler/releases{/id}","created_at":"2015-06-09T14:15:17Z","updated_at":"2015-06-09T14:15:17Z","pushed_at":"2015-07-15T15:35:10Z","git_url":"git://github.com/petervtzand/rq-scheduler.git","ssh_url":"git@github.com:petervtzand/rq-scheduler.git","clone_url":"https://github.com/petervtzand/rq-scheduler.git","svn_url":"https://github.com/petervtzand/rq-scheduler","homepage":"","size":439,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ui:master","ref":"master","sha":"80b6fdad7c8154bf915a2475467ed554482b665c","user":{"login":"ui","id":210428,"avatar_url":"https://avatars.githubusercontent.com/u/210428?v=3","gravatar_id":"","url":"https://api.github.com/users/ui","html_url":"https://github.com/ui","followers_url":"https://api.github.com/users/ui/followers","following_url":"https://api.github.com/users/ui/following{/other_user}","gists_url":"https://api.github.com/users/ui/gists{/gist_id}","starred_url":"https://api.github.com/users/ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ui/subscriptions","organizations_url":"https://api.github.com/users/ui/orgs","repos_url":"https://api.github.com/users/ui/repos","events_url":"https://api.github.com/users/ui/events{/privacy}","received_events_url":"https://api.github.com/users/ui/received_events","type":"User","site_admin":false},"repo":{"id":4674035,"name":"rq-scheduler","full_name":"ui/rq-scheduler","owner":{"login":"ui","id":210428,"avatar_url":"https://avatars.githubusercontent.com/u/210428?v=3","gravatar_id":"","url":"https://api.github.com/users/ui","html_url":"https://github.com/ui","followers_url":"https://api.github.com/users/ui/followers","following_url":"https://api.github.com/users/ui/following{/other_user}","gists_url":"https://api.github.com/users/ui/gists{/gist_id}","starred_url":"https://api.github.com/users/ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ui/subscriptions","organizations_url":"https://api.github.com/users/ui/orgs","repos_url":"https://api.github.com/users/ui/repos","events_url":"https://api.github.com/users/ui/events{/privacy}","received_events_url":"https://api.github.com/users/ui/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ui/rq-scheduler","description":"A light library that adds job scheduling capabilities to RQ (Redis Queue)","fork":false,"url":"https://api.github.com/repos/ui/rq-scheduler","forks_url":"https://api.github.com/repos/ui/rq-scheduler/forks","keys_url":"https://api.github.com/repos/ui/rq-scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ui/rq-scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ui/rq-scheduler/teams","hooks_url":"https://api.github.com/repos/ui/rq-scheduler/hooks","issue_events_url":"https://api.github.com/repos/ui/rq-scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/ui/rq-scheduler/events","assignees_url":"https://api.github.com/repos/ui/rq-scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/ui/rq-scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/ui/rq-scheduler/tags","blobs_url":"https://api.github.com/repos/ui/rq-scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ui/rq-scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ui/rq-scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/ui/rq-scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ui/rq-scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/ui/rq-scheduler/languages","stargazers_url":"https://api.github.com/repos/ui/rq-scheduler/stargazers","contributors_url":"https://api.github.com/repos/ui/rq-scheduler/contributors","subscribers_url":"https://api.github.com/repos/ui/rq-scheduler/subscribers","subscription_url":"https://api.github.com/repos/ui/rq-scheduler/subscription","commits_url":"https://api.github.com/repos/ui/rq-scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/ui/rq-scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/ui/rq-scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/ui/rq-scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/ui/rq-scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/ui/rq-scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ui/rq-scheduler/merges","archive_url":"https://api.github.com/repos/ui/rq-scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ui/rq-scheduler/downloads","issues_url":"https://api.github.com/repos/ui/rq-scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/ui/rq-scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/ui/rq-scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/ui/rq-scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ui/rq-scheduler/labels{/name}","releases_url":"https://api.github.com/repos/ui/rq-scheduler/releases{/id}","created_at":"2012-06-15T10:45:48Z","updated_at":"2015-08-13T20:07:42Z","pushed_at":"2015-08-05T02:09:26Z","git_url":"git://github.com/ui/rq-scheduler.git","ssh_url":"git@github.com:ui/rq-scheduler.git","clone_url":"https://github.com/ui/rq-scheduler.git","svn_url":"https://github.com/ui/rq-scheduler","homepage":"","size":772,"stargazers_count":295,"watchers_count":295,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":19,"forks":62,"open_issues":19,"watchers":295,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ui/rq-scheduler/pulls/80"},"html":{"href":"https://github.com/ui/rq-scheduler/pull/80"},"issue":{"href":"https://api.github.com/repos/ui/rq-scheduler/issues/80"},"comments":{"href":"https://api.github.com/repos/ui/rq-scheduler/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/ui/rq-scheduler/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/ui/rq-scheduler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ui/rq-scheduler/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/ui/rq-scheduler/statuses/305098986edf661db378d0ed9c04508c4d88953f"}}}}