From 6843900ec63a808110ee7a047cf9582718c737e2 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 6 Apr 2019 12:50:28 -0400 Subject: [PATCH] Change max assign time --- jenkins/Jenkinsfile | 1 + jenkins/deploy.sh | 2 +- tasks.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 0f9aa9b..6447197 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -39,6 +39,7 @@ pipeline { sshPut remote: remote, from: 'uwsgi.py', into: 'od-database' sshPut remote: remote, from: 'views.py', into: 'od-database' sshPut remote: remote, from: 'config.py', into: 'od-database' + sshPut remote: remote, from: 'do_recrawl.py', into: 'od-database' sshPut remote: remote, from: 'od-database.ini', into: 'od-database' sshPut remote: remote, from: 'jenkins/deploy.sh', into: 'od-database' sshCommand remote: remote, command: 'chmod +x od-database/deploy.sh && ./od-database/deploy.sh' diff --git a/jenkins/deploy.sh b/jenkins/deploy.sh index 606f413..1ca88ba 100755 --- a/jenkins/deploy.sh +++ b/jenkins/deploy.sh @@ -18,7 +18,7 @@ screen -list echo "Installing crontab" absolute_dir=$(cd ${ODDBROOT} && pwd) -command="cd \"${absolute_dir}\" && source env/bin/activate && python do_recrawl.py >> recrawl_logs.txt" +command="cd '${absolute_dir}' && source env/bin/activate && python do_recrawl.py >> recrawl_logs.txt" job="*/10 * * * * \"$command\"" echo "$job" cat <(fgrep -i -v \""$command"\" <(crontab -l)) <(echo "$job") | crontab - diff --git a/tasks.py b/tasks.py index cc7fb52..79d026d 100644 --- a/tasks.py +++ b/tasks.py @@ -140,7 +140,7 @@ class TaskManager: pool.close() def queue_task(self, task: Task): - max_assign_time = 24 * 7 * 3600 + max_assign_time = 24 * 4 * 3600 upload_token = uuid4().__str__() task.upload_token = upload_token