diff options
author | Antoine Beaupré <anarcat@debian.org> | 2018-11-22 11:39:16 -0500 |
---|---|---|
committer | Antoine Beaupré <anarcat@debian.org> | 2018-11-22 11:52:54 -0500 |
commit | e258331aaf79b6a1d6cb25921ca105b0d92dac2d (patch) | |
tree | 771a24319fcb462ab75769606e7a16b15ccbbf94 | |
parent | a280764d5c868061f52df24294b78e9b8f28f10a (diff) |
look at the latest between update and claimed dates
Previous implementation wouldn't detect updates to the file and only
looked at the claimed dates. This was an oversight: the goal was to
take into account normal edits to the claimed block as well, so that
users can "ping" the claim to extend their claim.
-rwxr-xr-x | bin/review-update-needed | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/review-update-needed b/bin/review-update-needed index fe4103b0d1..fea86f10f8 100755 --- a/bin/review-update-needed +++ b/bin/review-update-needed @@ -130,7 +130,10 @@ for entry in all_entries: args.quiet or print("Claimed-Date: {}".format(format_date(entry['claimed-date']))) if args.unclaim: - date_to_format = datetime.utcfromtimestamp(entry['claimed-date']) + if entry['last-update'] > entry['claimed-date']: + date_to_format = datetime.utcfromtimestamp(entry['last-update']) + else: + date_to_format = datetime.utcfromtimestamp(entry['claimed-date']) if datetime.utcnow() - date_to_format > unclaim_delta: unclaim_pkgs.append(entry['pkg']) args.quiet or print("Unclaimed: idle for more than {}: {}".format(unclaim_delta, datetime.utcnow() - date_to_format)) |