{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/paasta/pulls/comments/145177174","pull_request_review_id":69938315,"id":145177174,"diff_hunk":"@@ -133,10 +134,18 @@ def filter_expired_tmp_jobs(client, job_names):\n         )\n         for job in temporary_jobs:\n             last_run_time, last_run_state = chronos_tools.get_status_last_run(job)\n+            chronos_job_config = chronos_tools.load_chronos_job_config(\n+                service=service,\n+                instance=instance,\n+                cluster=cluster,\n+                soa_dir=soa_dir,\n+            )\n+            interval = chronos_job_config.get_schedule_interval_in_seconds()\n             if last_run_state != chronos_tools.LastRunState.NotRun:\n                 if ((datetime.datetime.now(dateutil.tz.tzutc()) -\n                      dateutil.parser.parse(last_run_time)) >\n-                        datetime.timedelta(days=1)):\n+                        datetime.timedelta(seconds=interval)):","path":"paasta_tools/cleanup_chronos_jobs.py","position":32,"original_position":32,"commit_id":"a1276d8f8118ef3f01cae1e3db3d1f9e3aef8d95","original_commit_id":"a1276d8f8118ef3f01cae1e3db3d1f9e3aef8d95","user":{"login":"keymone","id":7057,"avatar_url":"https://avatars3.githubusercontent.com/u/7057?v=4","gravatar_id":"","url":"https://api.github.com/users/keymone","html_url":"https://github.com/keymone","followers_url":"https://api.github.com/users/keymone/followers","following_url":"https://api.github.com/users/keymone/following{/other_user}","gists_url":"https://api.github.com/users/keymone/gists{/gist_id}","starred_url":"https://api.github.com/users/keymone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keymone/subscriptions","organizations_url":"https://api.github.com/users/keymone/orgs","repos_url":"https://api.github.com/users/keymone/repos","events_url":"https://api.github.com/users/keymone/events{/privacy}","received_events_url":"https://api.github.com/users/keymone/received_events","type":"User","site_admin":false},"body":"this means jobs with short interval are now removed much faster - do developers rely on having a day worth of history? maybe we want something like `max(1 day, job interval)` so we never go lower than 1 day?","created_at":"2017-10-17T16:04:20Z","updated_at":"2017-10-17T16:04:20Z","html_url":"https://github.com/Yelp/paasta/pull/1559#discussion_r145177174","pull_request_url":"https://api.github.com/repos/Yelp/paasta/pulls/1559","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/comments/145177174"},"html":{"href":"https://github.com/Yelp/paasta/pull/1559#discussion_r145177174"},"pull_request":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1559"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/paasta/pulls/1559","id":146919731,"html_url":"https://github.com/Yelp/paasta/pull/1559","diff_url":"https://github.com/Yelp/paasta/pull/1559.diff","patch_url":"https://github.com/Yelp/paasta/pull/1559.patch","issue_url":"https://api.github.com/repos/Yelp/paasta/issues/1559","number":1559,"state":"open","locked":false,"title":"Only remove tmp jobs if they finished longer than one schedule interv…","user":{"login":"jglukasik","id":6445082,"avatar_url":"https://avatars3.githubusercontent.com/u/6445082?v=4","gravatar_id":"","url":"https://api.github.com/users/jglukasik","html_url":"https://github.com/jglukasik","followers_url":"https://api.github.com/users/jglukasik/followers","following_url":"https://api.github.com/users/jglukasik/following{/other_user}","gists_url":"https://api.github.com/users/jglukasik/gists{/gist_id}","starred_url":"https://api.github.com/users/jglukasik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglukasik/subscriptions","organizations_url":"https://api.github.com/users/jglukasik/orgs","repos_url":"https://api.github.com/users/jglukasik/repos","events_url":"https://api.github.com/users/jglukasik/events{/privacy}","received_events_url":"https://api.github.com/users/jglukasik/received_events","type":"User","site_admin":false},"body":"…al ago\r\n\r\nTo fix the bug where: 1) a batch with a long schedule (like once a month) fails, 2) the developer manually runs `paasta rerun` to fix it, 3) the Sensu check clears at first, but then goes back to failing after the tmp job is removed after one day.\r\n\r\nThis will remove a tmp job only if it finished longer than one schedule interval ago.","created_at":"2017-10-17T00:42:30Z","updated_at":"2017-10-17T16:04:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be1586a6f50cede1acd33c5821fbb61bdafe25ea","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/paasta/pulls/1559/commits","review_comments_url":"https://api.github.com/repos/Yelp/paasta/pulls/1559/comments","review_comment_url":"https://api.github.com/repos/Yelp/paasta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/paasta/issues/1559/comments","statuses_url":"https://api.github.com/repos/Yelp/paasta/statuses/a1276d8f8118ef3f01cae1e3db3d1f9e3aef8d95","head":{"label":"Yelp:u/jgl/PAASTA-13266_smarter_tmp_job_cleanup","ref":"u/jgl/PAASTA-13266_smarter_tmp_job_cleanup","sha":"a1276d8f8118ef3f01cae1e3db3d1f9e3aef8d95","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":44998824,"name":"paasta","full_name":"Yelp/paasta","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/paasta","description":"An open, distributed platform as a service","fork":false,"url":"https://api.github.com/repos/Yelp/paasta","forks_url":"https://api.github.com/repos/Yelp/paasta/forks","keys_url":"https://api.github.com/repos/Yelp/paasta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/paasta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/paasta/teams","hooks_url":"https://api.github.com/repos/Yelp/paasta/hooks","issue_events_url":"https://api.github.com/repos/Yelp/paasta/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/paasta/events","assignees_url":"https://api.github.com/repos/Yelp/paasta/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/paasta/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/paasta/tags","blobs_url":"https://api.github.com/repos/Yelp/paasta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/paasta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/paasta/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/paasta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/paasta/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/paasta/languages","stargazers_url":"https://api.github.com/repos/Yelp/paasta/stargazers","contributors_url":"https://api.github.com/repos/Yelp/paasta/contributors","subscribers_url":"https://api.github.com/repos/Yelp/paasta/subscribers","subscription_url":"https://api.github.com/repos/Yelp/paasta/subscription","commits_url":"https://api.github.com/repos/Yelp/paasta/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/paasta/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/paasta/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/paasta/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/paasta/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/paasta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/paasta/merges","archive_url":"https://api.github.com/repos/Yelp/paasta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/paasta/downloads","issues_url":"https://api.github.com/repos/Yelp/paasta/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/paasta/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/paasta/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/paasta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/paasta/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/paasta/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/paasta/deployments","created_at":"2015-10-26T21:35:53Z","updated_at":"2017-10-16T09:25:23Z","pushed_at":"2017-10-17T15:56:18Z","git_url":"git://github.com/Yelp/paasta.git","ssh_url":"git@github.com:Yelp/paasta.git","clone_url":"https://github.com/Yelp/paasta.git","svn_url":"https://github.com/Yelp/paasta","homepage":"","size":54133,"stargazers_count":1132,"watchers_count":1132,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":140,"mirror_url":null,"open_issues_count":101,"forks":140,"open_issues":101,"watchers":1132,"default_branch":"master"}},"base":{"label":"Yelp:master","ref":"master","sha":"5321a3f2d8738206f4da3fcadbae9c13f3e8aa4e","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":44998824,"name":"paasta","full_name":"Yelp/paasta","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/paasta","description":"An open, distributed platform as a service","fork":false,"url":"https://api.github.com/repos/Yelp/paasta","forks_url":"https://api.github.com/repos/Yelp/paasta/forks","keys_url":"https://api.github.com/repos/Yelp/paasta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/paasta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/paasta/teams","hooks_url":"https://api.github.com/repos/Yelp/paasta/hooks","issue_events_url":"https://api.github.com/repos/Yelp/paasta/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/paasta/events","assignees_url":"https://api.github.com/repos/Yelp/paasta/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/paasta/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/paasta/tags","blobs_url":"https://api.github.com/repos/Yelp/paasta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/paasta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/paasta/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/paasta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/paasta/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/paasta/languages","stargazers_url":"https://api.github.com/repos/Yelp/paasta/stargazers","contributors_url":"https://api.github.com/repos/Yelp/paasta/contributors","subscribers_url":"https://api.github.com/repos/Yelp/paasta/subscribers","subscription_url":"https://api.github.com/repos/Yelp/paasta/subscription","commits_url":"https://api.github.com/repos/Yelp/paasta/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/paasta/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/paasta/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/paasta/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/paasta/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/paasta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/paasta/merges","archive_url":"https://api.github.com/repos/Yelp/paasta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/paasta/downloads","issues_url":"https://api.github.com/repos/Yelp/paasta/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/paasta/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/paasta/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/paasta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/paasta/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/paasta/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/paasta/deployments","created_at":"2015-10-26T21:35:53Z","updated_at":"2017-10-16T09:25:23Z","pushed_at":"2017-10-17T15:56:18Z","git_url":"git://github.com/Yelp/paasta.git","ssh_url":"git@github.com:Yelp/paasta.git","clone_url":"https://github.com/Yelp/paasta.git","svn_url":"https://github.com/Yelp/paasta","homepage":"","size":54133,"stargazers_count":1132,"watchers_count":1132,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":140,"mirror_url":null,"open_issues_count":101,"forks":140,"open_issues":101,"watchers":1132,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1559"},"html":{"href":"https://github.com/Yelp/paasta/pull/1559"},"issue":{"href":"https://api.github.com/repos/Yelp/paasta/issues/1559"},"comments":{"href":"https://api.github.com/repos/Yelp/paasta/issues/1559/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1559/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1559/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/paasta/statuses/a1276d8f8118ef3f01cae1e3db3d1f9e3aef8d95"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"keymone"}}