Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 393e43c519be668d998f1a9629b8889ec546a527
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Dec 11 14:04:09 2013 +0100
[backend] store jobs in id-chroot.json file
to prevent overwritten by another task of the same id but different chroot
---------------------------------------------------------------
copr-be.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/copr-be.py b/copr-be.py
index ce94460..fa934a7 100755
--- a/copr-be.py
+++ b/copr-be.py
@@ -61,11 +61,12 @@ class CoprJobGrab(multiprocessing.Process):
count = 0
for b in r_json['builds']:
if 'id' in b:
- jobfile = self.opts.jobsdir + '/%s.json' %
b['id']
- if not os.path.exists(jobfile) and b['id'] not in
self.added_jobs:
+ extended_id = "%s-%s" % (b['id'],
b['chroot'])
+ jobfile = self.opts.jobsdir + '/%s.json' % extended_id
+ if not os.path.exists(jobfile) and extended_id not in
self.added_jobs:
count += 1
open(jobfile, 'w').write(json.dumps(b))
- self.event('Wrote job: %s' % b['id'])
+ self.event('Wrote job: %s' % extended_id)
if count:
self.event('New jobs: %s' % count)
if 'actions' in r_json and r_json['actions']: