Commit c5851729 authored by Andreas Tille's avatar Andreas Tille

Add some statistics and move delay time before real reading attempt

parent fb1357e0
......@@ -103,6 +103,7 @@ LAST_ACTIVITY_LENGTH=len(LAST_ACTIVITY)
blends_groups = get_blends_groups()
for group in blends_groups:
unchanged, changed, new = (0, 0, 0)
gpath = group.attributes['path']
blend = BLENDSGROUPS[group.attributes['name']]
projects = group.projects.list(all=True, order_by='name', sort='asc')
......@@ -114,7 +115,6 @@ for group in blends_groups:
# FIXME: try adding sleep(60) statements in the main loop or so
# For the moment wait for responses to https://lists.debian.org/debian-devel/2018/07/msg00119.html
# before implementing anything based on wild guessing
time.sleep(SLEEPTIME)
project = gl.projects.get(pr.attributes['id']) # without this extra get repository_tree() fails
name = project.attributes['name']
namedir = os.path.join(TARGETDIR, name[0])
......@@ -129,13 +129,16 @@ for group in blends_groups:
last_activity_at = line[LAST_ACTIVITY_LENGTH:].strip()
if last_activity_at == project.attributes['last_activity_at']:
dosomething=False
unchanged += 1
if debug > 0:
print("Do nothing in %s since found last_activity_at %s == repository %s" % (name, last_activity_at, project.attributes['last_activity_at']))
else:
if debug > 0:
changed += 1
print("Continue with %s since found last_activity_at %s != repository %s\n" % (name, last_activity_at, project.attributes['last_activity_at']))
invcs.close()
except FileNotFoundError:
new += 1
pass
if not dosomething:
continue
......@@ -147,8 +150,12 @@ for group in blends_groups:
out.write("%s%s\n" % (LAST_ACTIVITY, project.attributes['last_activity_at']))
out.close()
# print(project)
# be friendly to Salsa and add some delay timr before real reading of data
# see thread around https://lists.debian.org/debian-devel/2018/07/msg00125.html
time.sleep(SLEEPTIME)
if output_metadata('debian', debianmetadata):
output_metadata('debian/upstream', upstreammetadata)
print("In %s %i repositories changed, %i remained unchanged and %i were new." % (blend, changed, unchanged, new))
# os.system("tar --exclude=*README.Debian -caf %s %s" % (MACHINEREADABLEARCHIVE, TARGETDIR))
p = subprocess.Popen(['tar', '--exclude=*README.Debian', '-caf', MACHINEREADABLEARCHIVE, TDNAME], cwd=os.environ['HOME'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment