From a25cd03a2f883c3e3f8e8d426275a787b957b1d1 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 08 2017 09:10:56 +0000 Subject: [PATCH 1/2] Specify a different connection and read timeout Fixes https://pagure.io/pagure/issue/2834 (hopefully) Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure-ci/pagure_ci_server.py b/pagure-ci/pagure_ci_server.py index 16f3637..523451b 100644 --- a/pagure-ci/pagure_ci_server.py +++ b/pagure-ci/pagure_ci_server.py @@ -103,7 +103,7 @@ def handle_messages(): 'REPO': repo, 'BRANCH': branch }, - timeout=60, + timeout=(30, 60), ) except requests.exceptions.Timeout as err: _log.debug('Request timed-out: %s' % err) From f565842d0735c67f5db4c8da3a78ca4779ac061f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 08 2017 09:18:26 +0000 Subject: [PATCH 2/2] Fix running the tests, REDIS isn't always defined Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 5fb8fac..c3a8aac 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -4483,20 +4483,21 @@ def add_metadata_update_notif(session, obj, messages, user, gitfolder): # Make sure we won't have SQLAlchemy error before we continue session.commit() - REDIS.publish( - 'pagure.%s' % obj.uid, json.dumps({ - 'comment_id': obj_comment.id, - '%s_id' % obj.isa: obj.id, - 'project': obj.project.fullname, - 'comment_added': text2markdown(obj_comment.comment), - 'comment_user': obj_comment.user.user, - 'avatar_url': avatar_url_from_email( - obj_comment.user.default_email, size=16), - 'comment_date': obj_comment.date_created.strftime( - '%Y-%m-%d %H:%M:%S'), - 'notification': True, - }) - ) + if REDIS: + REDIS.publish( + 'pagure.%s' % obj.uid, json.dumps({ + 'comment_id': obj_comment.id, + '%s_id' % obj.isa: obj.id, + 'project': obj.project.fullname, + 'comment_added': text2markdown(obj_comment.comment), + 'comment_user': obj_comment.user.user, + 'avatar_url': avatar_url_from_email( + obj_comment.user.default_email, size=16), + 'comment_date': obj_comment.date_created.strftime( + '%Y-%m-%d %H:%M:%S'), + 'notification': True, + }) + ) if gitfolder: pagure.lib.git.update_git(