ignore cronjobs that hasn't written any status file yet
This commit is contained in:
parent
572f43010e
commit
a69cde3160
@ -207,10 +207,16 @@ def main():
|
|||||||
|
|
||||||
previous_runs = {}
|
previous_runs = {}
|
||||||
for root, dirs, files in os.walk(os.path.join(args.cachedir[0], args.name)):
|
for root, dirs, files in os.walk(os.path.join(args.cachedir[0], args.name)):
|
||||||
previous_runs = {
|
for d in dirs:
|
||||||
os.path.join(root, d): datetime.datetime.strptime(d, time_format)
|
if datetime.datetime.strptime(d, time_format) < datetime.datetime.strptime(nowstr, time_format):
|
||||||
for d in dirs
|
with open(os.path.join(root, d, 'result'), 'r') as f:
|
||||||
if datetime.datetime.strptime(d, time_format) < datetime.datetime.strptime(nowstr, time_format)}
|
try:
|
||||||
|
retcode = f.read().splitlines()[-1]
|
||||||
|
except IndexError:
|
||||||
|
# Previous run is probably not completed yet, ignore
|
||||||
|
# this entry
|
||||||
|
continue
|
||||||
|
previous_runs[os.path.join(root, d)] = datetime.datetime.strptime(d, time_format)
|
||||||
break
|
break
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
|
Loading…
Reference in New Issue
Block a user