{"action":"created","comment":{"url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/comments/299394205","pull_request_review_id":256777192,"id":299394205,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5OTM5NDIwNQ==","diff_hunk":"@@ -16,59 +16,63 @@\n \n const async = require('async');\n const chalk = require('chalk');\n-const CronJob = require('cron').CronJob;\n+const {CronJob} = require('cron');\n \n module.exports = initTask;\n exports.runPa11yOnTasks = runPa11yOnTasks;\n \n // Initialise the task\n function initTask(config, app) {\n+\n \tif (!config.cron) {\n \t\tconfig.cron = '0 30 0 * * *'; // 00:30 daily\n \t}\n \tconst job = new CronJob(config.cron, run.bind(null, app));\n \tjob.start();\n+\n }\n \n // Run the task\n function run(app) {\n+\n \tconsole.log('');\n \tconsole.log(chalk.grey('Starting to run tasks @ %s'), new Date());\n+\n \tasync.waterfall([\n \n-\t\tfunction(next) {\n-\t\t\tapp.model.task.getAll(next);\n-\t\t},\n+\t\tnext => app.model.task.getAll(next),\n \n-\t\tfunction(tasks, next) {\n-\t\t\trunPa11yOnTasks(tasks, app, next);\n-\t\t}\n+\t\t(tasks, next) => runPa11yOnTasks(tasks, app, next)\n+\n+\t], error => {\n \n-\t], function(error) {\n \t\tif (error) {\n \t\t\tconsole.error(chalk.red('Failed to run tasks: %s'), error.message);\n \t\t\tconsole.log('');\n \t\t\tprocess.exit(1);\n \t\t}\n+\n \t});\n+\n }\n \n // Run Pa11y on an array of tasks\n function runPa11yOnTasks(tasks, app, done) {\n \n-\tconst queue = async.queue(function(task, nextInQueue) {\n+\tconst queue = async.queue((task, nextInQueue) => {\n \t\tconsole.log('Starting task %s', task.id);\n-\t\tapp.model.task.runById(task.id, function(error) {\n+\t\tapp.model.task.runById(task.id, error => {\n \t\t\tif (error) {\n \t\t\t\tconsole.log(chalk.red('Failed to finish task %s: %s'), task.id, error.message);","path":"task/pa11y.js","position":61,"original_position":61,"commit_id":"f986c1cefa3ddbd59f1224446cb730035b6f2013","original_commit_id":"f986c1cefa3ddbd59f1224446cb730035b6f2013","user":{"login":"josebolos","id":1792637,"node_id":"MDQ6VXNlcjE3OTI2Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/1792637?v=4","gravatar_id":"","url":"https://api.github.com/users/josebolos","html_url":"https://github.com/josebolos","followers_url":"https://api.github.com/users/josebolos/followers","following_url":"https://api.github.com/users/josebolos/following{/other_user}","gists_url":"https://api.github.com/users/josebolos/gists{/gist_id}","starred_url":"https://api.github.com/users/josebolos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josebolos/subscriptions","organizations_url":"https://api.github.com/users/josebolos/orgs","repos_url":"https://api.github.com/users/josebolos/repos","events_url":"https://api.github.com/users/josebolos/events{/privacy}","received_events_url":"https://api.github.com/users/josebolos/received_events","type":"User","site_admin":false},"body":"Ditto about template literals?","created_at":"2019-07-02T09:39:37Z","updated_at":"2019-07-02T09:48:06Z","html_url":"https://github.com/pa11y/pa11y-webservice/pull/81#discussion_r299394205","pull_request_url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/comments/299394205"},"html":{"href":"https://github.com/pa11y/pa11y-webservice/pull/81#discussion_r299394205"},"pull_request":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81","id":291988389,"node_id":"MDExOlB1bGxSZXF1ZXN0MjkxOTg4Mzg5","html_url":"https://github.com/pa11y/pa11y-webservice/pull/81","diff_url":"https://github.com/pa11y/pa11y-webservice/pull/81.diff","patch_url":"https://github.com/pa11y/pa11y-webservice/pull/81.patch","issue_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/81","number":81,"state":"open","locked":false,"title":"Use es6 features","user":{"login":"joeyciechanowicz","id":1148637,"node_id":"MDQ6VXNlcjExNDg2Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/1148637?v=4","gravatar_id":"","url":"https://api.github.com/users/joeyciechanowicz","html_url":"https://github.com/joeyciechanowicz","followers_url":"https://api.github.com/users/joeyciechanowicz/followers","following_url":"https://api.github.com/users/joeyciechanowicz/following{/other_user}","gists_url":"https://api.github.com/users/joeyciechanowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/joeyciechanowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeyciechanowicz/subscriptions","organizations_url":"https://api.github.com/users/joeyciechanowicz/orgs","repos_url":"https://api.github.com/users/joeyciechanowicz/repos","events_url":"https://api.github.com/users/joeyciechanowicz/events{/privacy}","received_events_url":"https://api.github.com/users/joeyciechanowicz/received_events","type":"User","site_admin":false},"body":"Says what it does on the tin!","created_at":"2019-06-26T13:26:08Z","updated_at":"2019-07-02T09:48:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8941044a0019ef6164210934ba1bdcbd0bf58fb5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":56100716,"node_id":"MDU6TGFiZWw1NjEwMDcxNg==","url":"https://api.github.com/repos/pa11y/pa11y-webservice/labels/type:%20enhancement","name":"type: enhancement","color":"009800","default":false}],"milestone":{"url":"https://api.github.com/repos/pa11y/pa11y-webservice/milestones/1","html_url":"https://github.com/pa11y/pa11y-webservice/milestone/1","labels_url":"https://api.github.com/repos/pa11y/pa11y-webservice/milestones/1/labels","id":4455349,"node_id":"MDk6TWlsZXN0b25lNDQ1NTM0OQ==","number":1,"title":"v3.0.0","description":null,"creator":{"login":"josebolos","id":1792637,"node_id":"MDQ6VXNlcjE3OTI2Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/1792637?v=4","gravatar_id":"","url":"https://api.github.com/users/josebolos","html_url":"https://github.com/josebolos","followers_url":"https://api.github.com/users/josebolos/followers","following_url":"https://api.github.com/users/josebolos/following{/other_user}","gists_url":"https://api.github.com/users/josebolos/gists{/gist_id}","starred_url":"https://api.github.com/users/josebolos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josebolos/subscriptions","organizations_url":"https://api.github.com/users/josebolos/orgs","repos_url":"https://api.github.com/users/josebolos/repos","events_url":"https://api.github.com/users/josebolos/events{/privacy}","received_events_url":"https://api.github.com/users/josebolos/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2019-07-01T16:02:50Z","updated_at":"2019-07-01T16:04:50Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81/commits","review_comments_url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81/comments","review_comment_url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/81/comments","statuses_url":"https://api.github.com/repos/pa11y/pa11y-webservice/statuses/f986c1cefa3ddbd59f1224446cb730035b6f2013","head":{"label":"pa11y:use-es6-features","ref":"use-es6-features","sha":"f986c1cefa3ddbd59f1224446cb730035b6f2013","user":{"login":"pa11y","id":16292300,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MjkyMzAw","avatar_url":"https://avatars2.githubusercontent.com/u/16292300?v=4","gravatar_id":"","url":"https://api.github.com/users/pa11y","html_url":"https://github.com/pa11y","followers_url":"https://api.github.com/users/pa11y/followers","following_url":"https://api.github.com/users/pa11y/following{/other_user}","gists_url":"https://api.github.com/users/pa11y/gists{/gist_id}","starred_url":"https://api.github.com/users/pa11y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pa11y/subscriptions","organizations_url":"https://api.github.com/users/pa11y/orgs","repos_url":"https://api.github.com/users/pa11y/repos","events_url":"https://api.github.com/users/pa11y/events{/privacy}","received_events_url":"https://api.github.com/users/pa11y/received_events","type":"Organization","site_admin":false},"repo":{"id":12780769,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc4MDc2OQ==","name":"pa11y-webservice","full_name":"pa11y/pa11y-webservice","private":false,"owner":{"login":"pa11y","id":16292300,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MjkyMzAw","avatar_url":"https://avatars2.githubusercontent.com/u/16292300?v=4","gravatar_id":"","url":"https://api.github.com/users/pa11y","html_url":"https://github.com/pa11y","followers_url":"https://api.github.com/users/pa11y/followers","following_url":"https://api.github.com/users/pa11y/following{/other_user}","gists_url":"https://api.github.com/users/pa11y/gists{/gist_id}","starred_url":"https://api.github.com/users/pa11y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pa11y/subscriptions","organizations_url":"https://api.github.com/users/pa11y/orgs","repos_url":"https://api.github.com/users/pa11y/repos","events_url":"https://api.github.com/users/pa11y/events{/privacy}","received_events_url":"https://api.github.com/users/pa11y/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pa11y/pa11y-webservice","description":"Pa11y Webservice provides scheduled accessibility reports for multiple URLs","fork":false,"url":"https://api.github.com/repos/pa11y/pa11y-webservice","forks_url":"https://api.github.com/repos/pa11y/pa11y-webservice/forks","keys_url":"https://api.github.com/repos/pa11y/pa11y-webservice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pa11y/pa11y-webservice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pa11y/pa11y-webservice/teams","hooks_url":"https://api.github.com/repos/pa11y/pa11y-webservice/hooks","issue_events_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/events{/number}","events_url":"https://api.github.com/repos/pa11y/pa11y-webservice/events","assignees_url":"https://api.github.com/repos/pa11y/pa11y-webservice/assignees{/user}","branches_url":"https://api.github.com/repos/pa11y/pa11y-webservice/branches{/branch}","tags_url":"https://api.github.com/repos/pa11y/pa11y-webservice/tags","blobs_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/refs{/sha}","trees_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pa11y/pa11y-webservice/statuses/{sha}","languages_url":"https://api.github.com/repos/pa11y/pa11y-webservice/languages","stargazers_url":"https://api.github.com/repos/pa11y/pa11y-webservice/stargazers","contributors_url":"https://api.github.com/repos/pa11y/pa11y-webservice/contributors","subscribers_url":"https://api.github.com/repos/pa11y/pa11y-webservice/subscribers","subscription_url":"https://api.github.com/repos/pa11y/pa11y-webservice/subscription","commits_url":"https://api.github.com/repos/pa11y/pa11y-webservice/commits{/sha}","git_commits_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/commits{/sha}","comments_url":"https://api.github.com/repos/pa11y/pa11y-webservice/comments{/number}","issue_comment_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/comments{/number}","contents_url":"https://api.github.com/repos/pa11y/pa11y-webservice/contents/{+path}","compare_url":"https://api.github.com/repos/pa11y/pa11y-webservice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pa11y/pa11y-webservice/merges","archive_url":"https://api.github.com/repos/pa11y/pa11y-webservice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pa11y/pa11y-webservice/downloads","issues_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues{/number}","pulls_url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls{/number}","milestones_url":"https://api.github.com/repos/pa11y/pa11y-webservice/milestones{/number}","notifications_url":"https://api.github.com/repos/pa11y/pa11y-webservice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pa11y/pa11y-webservice/labels{/name}","releases_url":"https://api.github.com/repos/pa11y/pa11y-webservice/releases{/id}","deployments_url":"https://api.github.com/repos/pa11y/pa11y-webservice/deployments","created_at":"2013-09-12T10:16:24Z","updated_at":"2019-06-26T12:59:16Z","pushed_at":"2019-06-26T13:29:43Z","git_url":"git://github.com/pa11y/pa11y-webservice.git","ssh_url":"git@github.com:pa11y/pa11y-webservice.git","clone_url":"https://github.com/pa11y/pa11y-webservice.git","svn_url":"https://github.com/pa11y/pa11y-webservice","homepage":"http://pa11y.org/","size":304,"stargazers_count":99,"watchers_count":99,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":10,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":35,"open_issues":10,"watchers":99,"default_branch":"master"}},"base":{"label":"pa11y:master","ref":"master","sha":"c57426d1a21df1ec72b6f25728215d42de462487","user":{"login":"pa11y","id":16292300,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MjkyMzAw","avatar_url":"https://avatars2.githubusercontent.com/u/16292300?v=4","gravatar_id":"","url":"https://api.github.com/users/pa11y","html_url":"https://github.com/pa11y","followers_url":"https://api.github.com/users/pa11y/followers","following_url":"https://api.github.com/users/pa11y/following{/other_user}","gists_url":"https://api.github.com/users/pa11y/gists{/gist_id}","starred_url":"https://api.github.com/users/pa11y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pa11y/subscriptions","organizations_url":"https://api.github.com/users/pa11y/orgs","repos_url":"https://api.github.com/users/pa11y/repos","events_url":"https://api.github.com/users/pa11y/events{/privacy}","received_events_url":"https://api.github.com/users/pa11y/received_events","type":"Organization","site_admin":false},"repo":{"id":12780769,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc4MDc2OQ==","name":"pa11y-webservice","full_name":"pa11y/pa11y-webservice","private":false,"owner":{"login":"pa11y","id":16292300,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MjkyMzAw","avatar_url":"https://avatars2.githubusercontent.com/u/16292300?v=4","gravatar_id":"","url":"https://api.github.com/users/pa11y","html_url":"https://github.com/pa11y","followers_url":"https://api.github.com/users/pa11y/followers","following_url":"https://api.github.com/users/pa11y/following{/other_user}","gists_url":"https://api.github.com/users/pa11y/gists{/gist_id}","starred_url":"https://api.github.com/users/pa11y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pa11y/subscriptions","organizations_url":"https://api.github.com/users/pa11y/orgs","repos_url":"https://api.github.com/users/pa11y/repos","events_url":"https://api.github.com/users/pa11y/events{/privacy}","received_events_url":"https://api.github.com/users/pa11y/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pa11y/pa11y-webservice","description":"Pa11y Webservice provides scheduled accessibility reports for multiple URLs","fork":false,"url":"https://api.github.com/repos/pa11y/pa11y-webservice","forks_url":"https://api.github.com/repos/pa11y/pa11y-webservice/forks","keys_url":"https://api.github.com/repos/pa11y/pa11y-webservice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pa11y/pa11y-webservice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pa11y/pa11y-webservice/teams","hooks_url":"https://api.github.com/repos/pa11y/pa11y-webservice/hooks","issue_events_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/events{/number}","events_url":"https://api.github.com/repos/pa11y/pa11y-webservice/events","assignees_url":"https://api.github.com/repos/pa11y/pa11y-webservice/assignees{/user}","branches_url":"https://api.github.com/repos/pa11y/pa11y-webservice/branches{/branch}","tags_url":"https://api.github.com/repos/pa11y/pa11y-webservice/tags","blobs_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/refs{/sha}","trees_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pa11y/pa11y-webservice/statuses/{sha}","languages_url":"https://api.github.com/repos/pa11y/pa11y-webservice/languages","stargazers_url":"https://api.github.com/repos/pa11y/pa11y-webservice/stargazers","contributors_url":"https://api.github.com/repos/pa11y/pa11y-webservice/contributors","subscribers_url":"https://api.github.com/repos/pa11y/pa11y-webservice/subscribers","subscription_url":"https://api.github.com/repos/pa11y/pa11y-webservice/subscription","commits_url":"https://api.github.com/repos/pa11y/pa11y-webservice/commits{/sha}","git_commits_url":"https://api.github.com/repos/pa11y/pa11y-webservice/git/commits{/sha}","comments_url":"https://api.github.com/repos/pa11y/pa11y-webservice/comments{/number}","issue_comment_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/comments{/number}","contents_url":"https://api.github.com/repos/pa11y/pa11y-webservice/contents/{+path}","compare_url":"https://api.github.com/repos/pa11y/pa11y-webservice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pa11y/pa11y-webservice/merges","archive_url":"https://api.github.com/repos/pa11y/pa11y-webservice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pa11y/pa11y-webservice/downloads","issues_url":"https://api.github.com/repos/pa11y/pa11y-webservice/issues{/number}","pulls_url":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls{/number}","milestones_url":"https://api.github.com/repos/pa11y/pa11y-webservice/milestones{/number}","notifications_url":"https://api.github.com/repos/pa11y/pa11y-webservice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pa11y/pa11y-webservice/labels{/name}","releases_url":"https://api.github.com/repos/pa11y/pa11y-webservice/releases{/id}","deployments_url":"https://api.github.com/repos/pa11y/pa11y-webservice/deployments","created_at":"2013-09-12T10:16:24Z","updated_at":"2019-06-26T12:59:16Z","pushed_at":"2019-06-26T13:29:43Z","git_url":"git://github.com/pa11y/pa11y-webservice.git","ssh_url":"git@github.com:pa11y/pa11y-webservice.git","clone_url":"https://github.com/pa11y/pa11y-webservice.git","svn_url":"https://github.com/pa11y/pa11y-webservice","homepage":"http://pa11y.org/","size":304,"stargazers_count":99,"watchers_count":99,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":10,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":35,"open_issues":10,"watchers":99,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81"},"html":{"href":"https://github.com/pa11y/pa11y-webservice/pull/81"},"issue":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/81"},"comments":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/pa11y/pa11y-webservice/statuses/f986c1cefa3ddbd59f1224446cb730035b6f2013"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"josebolos"}}