This is an automated email from the git hooks/post-receive script.
clime pushed a change to branch pg_369
in repository copr/copr.
at 9717b9d [frontend] pg#369 Make pagure-events service load-balanceable
This branch includes the following new commits:
new 9717b9d [frontend] pg#369 Make pagure-events service load-balanceable
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date
This is an automated email from the git hooks/post-receive script.
clime pushed a commit to branch pg_369
in repository copr/copr.
commit 9717b9d682608e470ab38a2e316fd33847f77788
Author: clime <clime(a)redhat.com>
AuthorDate: Tue Nov 13 11:26:38 2018 +0100
[frontend] pg#369 Make pagure-events service load-balanceable
---
frontend/coprs_frontend/run/pagure-events.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/frontend/coprs_frontend/run/pagure-events.py
b/frontend/coprs_frontend/run/pagure-events.py
index 609674d..3d66528 100755
--- a/frontend/coprs_frontend/run/pagure-events.py
+++ b/frontend/coprs_frontend/run/pagure-events.py
@@ -14,7 +14,7 @@ sys.path.append(
os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
)
-from coprs import db, app
+from coprs import db, app, models
from coprs.logic.coprs_logic import CoprDirsLogic
from coprs.logic.builds_logic import BuildsLogic
from coprs.logic.complex_logic import ComplexLogic
@@ -74,12 +74,15 @@ class ScmPackage(object):
else:
package = self.package
- build = BuildsLogic.rebuild_package(
+ db.session.execute('LOCK TABLE build IN EXCLUSIVE MODE')
+ if models.Build.query.filter(models.Build.scm_object_url ==
scm_object_url).first():
+ log.info('\t -> Build for {} already
exists.'.format(scm_object_url))
+ return None
+
+ return BuildsLogic.rebuild_package(
package, source_dict_update, copr_dir, update_callback,
scm_object_type, scm_object_id, scm_object_url)
- return build
-
@classmethod
def get_candidates_for_rebuild(cls, clone_url):
if db.engine.url.drivername == 'sqlite':
@@ -262,7 +265,7 @@ def build_on_fedmsg_loop():
and (not pkg.committish or
event_info.branch_to.endswith(pkg.committish))
and pkg.is_dir_in_commit(raw_commit_text)):
- log.info('\t -> rebuilding.')
+ log.info('\t -> accepted.')
if event_info.object_type == 'pull-request':
dirname = pkg.copr.name + ':pr:' + str(event_info.object_id)
@@ -292,7 +295,9 @@ def build_on_fedmsg_loop():
event_info.object_id,
scm_object_url
)
- log.info('\t -> {}'.format(build.to_dict()))
+ if build:
+ log.info('\t -> {}'.format(build.to_dict()))
+
db.session.commit()
else:
log.info('\t -> skipping.')
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.