diff options
Diffstat (limited to 'monitor/josef_mover.py')
-rwxr-xr-x | monitor/josef_mover.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/monitor/josef_mover.py b/monitor/josef_mover.py index 2267d00..3a5ae42 100755 --- a/monitor/josef_mover.py +++ b/monitor/josef_mover.py @@ -51,7 +51,7 @@ def print_reply(rep, entry): def is_new_timestamp(ts): MAX_TIMEDIFF = 300 # 5 min, allows for some clock skew ts_time = datetime.datetime.fromtimestamp(ts / 1000, UTC()).strftime('%Y-%m-%d %H:%M:%S') - start_time = datetime.datetime.utcnow().strftime('2015-10-19 00:00:00') + start_time = datetime.datetime.utcnow().strftime('2015-11-02 00:00:00') # delta_time = datetime.datetime.strptime(start_time, '%Y-%m-%d %H:%M:%S') - datetime.datetime.strptime(ts_time, '%Y-%m-%d %H:%M:%S') # print delta_time.seconds if ts_time < start_time: @@ -70,7 +70,7 @@ def check_inclusion_all(first, last, source, dest): for e in entries: inclusions = [] - print base64.b64decode(e["leaf_input"]) + # print base64.b64decode(e["leaf_input"]) h = get_leaf_hash(base64.b64decode(e["leaf_input"])) for log in dest: url = log["url"] @@ -190,14 +190,15 @@ def check_submission_inner(d_log, item, inclusions): res = add_prechain(d_log["url"], {"chain" : submission}) else: res = add_chain(d_log["url"], {"chain" : submission}) + # print res if not is_new_timestamp(res["timestamp"]): inclusions.append(d_log["name"]) def check_submission_outer(first, last, s_log, dest, logfile=None): MAX_CHUNK_SIZE = 65 - MAX_RETRIES = 3 + MAX_RETRIES = 1 idx = 0 - while first + idx < last: + while first + idx <= last: if first + idx + MAX_CHUNK_SIZE < last: tmp_last = first + idx + MAX_CHUNK_SIZE - 1 else: @@ -207,6 +208,7 @@ def check_submission_outer(first, last, s_log, dest, logfile=None): while retries <= MAX_RETRIES: try: print "Getting " + str(first + idx) + " to " + str(tmp_last) + # print s_log entries = get_entries(s_log["url"], first + idx, tmp_last)["entries"] break except Exception, e: @@ -296,11 +298,12 @@ def log(fn, string): if __name__ == "__main__": - source = [CTLOGS[4]] + source = CTLOGS[0] dests = CTLOGS # stress_test([CTLOGS[0]]) - check_overlap(source, dests) + # check_overlap(source, dests) + check_submission_outer(10243750,10243750,source, dests) |