From 37c113b5d32630684fb143d46884d6ffd4975e36 Mon Sep 17 00:00:00 2001 From: mrugesh mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Thu, 27 Dec 2018 02:09:02 +0530 Subject: [PATCH] docs: update notes on the setup --- docs/CONTRIBUTING.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8f54162427..5310e86d8a 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -6,10 +6,21 @@ Todo Todo -## Caveat +## Caveats & Notes -The one-off scripts will error out on actions performed by repository admins, for example: +### The one-off scripts will error out on actions performed by repository admins, for example: -> If an admin removes a label from a Pull request, the script can not add that label back. This is usually because the script is acting on behalf of a non-admin user with write access. -> -> This is usually the case with the use of access tokens for scripts. +If an admin removes a label from a Pull request, the script can not add that label back. This is usually because the script is acting on behalf of a non-admin user with write access. + +This is usually the case with the use of access tokens for scripts. + +### Setting up Cron jobs for Sweeper Scripts + +For updating the pr correlation dataset we use PM2 like so: + +``` +pm2 start --no-autorestart sweeper/one-off-scripts/get-pr-relations-data.js --cron "*/10 * * * *" +``` + +This will start the script in the "no restart" mode and re-run it every 15 minutes. +Some useful links to calcuate a Cron expression: