Skip to content

Commit

Permalink
Fix a bug in get_vdl_log_file when logdir does not exist (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyfly authored Sep 2, 2021
1 parent d985994 commit be203c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions visualdl/server/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ def get_vdl_log_file(logdirs):
"exp2": "vdlrecords.1587375685.log"}
"""
walks = {}
walks_temp = {}
for logdir in logdirs:
for root, dirs, files in bfile.walk(logdir):
walks.update({root: files})

walks_temp = {}
for run, tags in walks.items():
tags_temp = [tag for tag in tags if
is_VDLRecord_file(path=bfile.join(run, tag), check=False)]
tags_temp.sort(reverse=True)
if len(tags_temp) > 0:
walks_temp.update({run: tags_temp[0]})
for run, tags in walks.items():
tags_temp = [tag for tag in tags if
is_VDLRecord_file(path=bfile.join(run, tag), check=False)]
tags_temp.sort(reverse=True)
if len(tags_temp) > 0:
walks_temp.update({run: tags_temp[0]})

return walks_temp

Expand Down

0 comments on commit be203c7

Please sign in to comment.