{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/46371399","id":46371399,"diff_hunk":"@@ -41,40 +41,46 @@ def crontab()\n   $crontab.join(\"\\n\")\n end\n \n+# for multi-instance envs (ie production) there should be one daemon,\n+# so cronjobs that run once per environment go here (standalone env\n+# instances are all their own daemon)\n if node['cdo-apps']['daemon']\n-  unless node.chef_environment == 'production'\n+  unless node.chef_environment == 'production' # non-production daemons\n     cronjob at:'@reboot', do:\"#{deploy_dir('bin','solr-server')} > #{pegasus_dir('log','solr.log')} 2>&1\"\n   end\n \n-  if node.chef_environment == 'staging' && node.name == 'staging'\n+  if node.chef_environment == 'staging' && node.name == 'staging' # 'real' staging only\n     cronjob at:'@reboot', do:home_dir('.dropbox-dist', 'dropboxd')\n     cronjob at:'*/5 * * * *', do:deploy_dir('bin', 'import_google_sheets')\n-    cronjob at:'*/2 * * * *', do:deploy_dir('bin','run_server_generate_pdfs'), notify:'brendan@code.org'\n-    cronjob at:'*/2 * * * *', do:pegasus_dir('sites','virtual','run_server_generate_curriculum_pdfs'), notify:'brian@code.org'\n-    cronjob at:'*/2 * * * *', do:pegasus_dir('sites','virtual','collate_pdfs'), notify:'brian@code.org'\n-    cronjob at:'*/2 * * * *', do:dashboard_dir('bin','build_scripts'), notify:'dev@code.org'\n-    cronjob at:'*/5 * * * *', do:deploy_dir('bin','fetch-external-resources'), notify:'dev@code.org'\n+    cronjob at:'*/2 * * * *', do:deploy_dir('bin','run_server_generate_pdfs'), notify:'dev+crontab@code.org'\n+    cronjob at:'*/2 * * * *', do:pegasus_dir('sites','virtual','run_server_generate_curriculum_pdfs'), notify:'dev+crontab@code.org'\n+    cronjob at:'*/2 * * * *', do:pegasus_dir('sites','virtual','collate_pdfs'), notify:'dev+crontab@code.org'\n+    cronjob at:'*/2 * * * *', do:dashboard_dir('bin','build_scripts'), notify:'dev+crontab@code.org'\n+    cronjob at:'*/5 * * * *', do:deploy_dir('bin','fetch-external-resources'), notify:'dev+crontab@code.org'\n   end\n \n-  if node.chef_environment == 'production'\n-    cronjob at:'*/15 * * * *', do:deploy_dir('bin','activity-monitor')\n-    cronjob at:'@daily', do:deploy_dir('bin', 'send_workshop_reminder_emails')\n-    cronjob at:'0 16 * * *', do:dashboard_dir('bin','scheduled_ops_emails')\n+  if node.chef_environment == 'production' # production daemon\n+    cronjob at:'5 6 * * *', do:deploy_dir('bin', 'send_workshop_reminder_emails')\n+    cronjob at:'15 16 * * *', do:dashboard_dir('bin','scheduled_ops_emails')\n     cronjob at:'*/1 * * * *', do:deploy_dir('bin', 'index-users-in-solr')\n-    cronjob at:'@daily', do:deploy_dir('bin', 'update-hoc-map')\n+    cronjob at:'25 7 * * *', do:deploy_dir('bin', 'update-hoc-map')\n   end\n \n-  cronjob at:'*/1 * * * *', do:deploy_dir('bin', 'process_forms')","path":"cookbooks/cdo-apps/templates/default/crontab.erb","position":41,"original_position":41,"commit_id":"d668f3280e3158a3efa45d6190f1735417a0feac","original_commit_id":"d668f3280e3158a3efa45d6190f1735417a0feac","user":{"login":"laurelfan","id":7763,"avatar_url":"https://avatars.githubusercontent.com/u/7763?v=3","gravatar_id":"","url":"https://api.github.com/users/laurelfan","html_url":"https://github.com/laurelfan","followers_url":"https://api.github.com/users/laurelfan/followers","following_url":"https://api.github.com/users/laurelfan/following{/other_user}","gists_url":"https://api.github.com/users/laurelfan/gists{/gist_id}","starred_url":"https://api.github.com/users/laurelfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurelfan/subscriptions","organizations_url":"https://api.github.com/users/laurelfan/orgs","repos_url":"https://api.github.com/users/laurelfan/repos","events_url":"https://api.github.com/users/laurelfan/events{/privacy}","received_events_url":"https://api.github.com/users/laurelfan/received_events","type":"User","site_admin":false},"body":"eek, this is broken: https://github.com/code-dot-org/code-dot-org/pull/5767","created_at":"2015-12-02T02:38:30Z","updated_at":"2015-12-02T02:38:30Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/5719#discussion_r46371399","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/46371399"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/5719#discussion_r46371399"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719","id":52211546,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/5719","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/5719.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/5719.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/5719","number":5719,"state":"closed","locked":false,"title":"clean up crontab","user":{"login":"laurelfan","id":7763,"avatar_url":"https://avatars.githubusercontent.com/u/7763?v=3","gravatar_id":"","url":"https://api.github.com/users/laurelfan","html_url":"https://github.com/laurelfan","followers_url":"https://api.github.com/users/laurelfan/followers","following_url":"https://api.github.com/users/laurelfan/following{/other_user}","gists_url":"https://api.github.com/users/laurelfan/gists{/gist_id}","starred_url":"https://api.github.com/users/laurelfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurelfan/subscriptions","organizations_url":"https://api.github.com/users/laurelfan/orgs","repos_url":"https://api.github.com/users/laurelfan/repos","events_url":"https://api.github.com/users/laurelfan/events{/privacy}","received_events_url":"https://api.github.com/users/laurelfan/received_events","type":"User","site_admin":false},"body":"* remove activity monitor (doesn't work)\r\n* distribute daily/hourly tasks throughout the hour (so we can more easily determine which/if crontabs are causing db load spikes...)\r\n* specify time for daily tasks (@daily == midnight UTC)\r\n* notify dev+crontab@code.org instead of individual developers\r\n* randomize time for logfile upload\r\n\r\nmanual testing:\r\n\r\nbefore-deploy copy of the crontab is sitting in /home/ubuntu/crontab-2015-12-01 on the following environments. diff this with the new crontab after deploy.\r\n- [x] staging\r\n- [x] test\r\n- [ ] production-daemon\r\n- [ ] production-console\r\n\r\nThis has a chef configuration change but is simple enough that it can be rolled back like any normal change.","created_at":"2015-12-01T03:21:27Z","updated_at":"2015-12-02T02:38:30Z","closed_at":"2015-12-02T00:10:07Z","merged_at":"2015-12-02T00:10:07Z","merge_commit_sha":"9616e2717d8d7acba183e51db72d21c6ca8fbd72","assignee":{"login":"philbogle","id":5198586,"avatar_url":"https://avatars.githubusercontent.com/u/5198586?v=3","gravatar_id":"","url":"https://api.github.com/users/philbogle","html_url":"https://github.com/philbogle","followers_url":"https://api.github.com/users/philbogle/followers","following_url":"https://api.github.com/users/philbogle/following{/other_user}","gists_url":"https://api.github.com/users/philbogle/gists{/gist_id}","starred_url":"https://api.github.com/users/philbogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbogle/subscriptions","organizations_url":"https://api.github.com/users/philbogle/orgs","repos_url":"https://api.github.com/users/philbogle/repos","events_url":"https://api.github.com/users/philbogle/events{/privacy}","received_events_url":"https://api.github.com/users/philbogle/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/5719/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/d668f3280e3158a3efa45d6190f1735417a0feac","head":{"label":"code-dot-org:crontab-cleanup","ref":"crontab-cleanup","sha":"d668f3280e3158a3efa45d6190f1735417a0feac","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-11-24T12:25:04Z","pushed_at":"2015-12-02T02:36:45Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":3577338,"stargazers_count":67,"watchers_count":67,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":66,"forks":42,"open_issues":66,"watchers":67,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"e1ad1c95fd292a468a8d0ee692ccbe22832acf5b","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-11-24T12:25:04Z","pushed_at":"2015-12-02T02:36:45Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":3577338,"stargazers_count":67,"watchers_count":67,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":66,"forks":42,"open_issues":66,"watchers":67,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/5719"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/5719"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/5719/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/5719/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/d668f3280e3158a3efa45d6190f1735417a0feac"}}}}