Skip to content

Commit be203c7

Browse files
authored
Fix a bug in get_vdl_log_file when logdir does not exist (#1002)
1 parent d985994 commit be203c7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

visualdl/server/serve.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ def get_vdl_log_file(logdirs):
6464
"exp2": "vdlrecords.1587375685.log"}
6565
"""
6666
walks = {}
67+
walks_temp = {}
6768
for logdir in logdirs:
6869
for root, dirs, files in bfile.walk(logdir):
6970
walks.update({root: files})
7071

71-
walks_temp = {}
72-
for run, tags in walks.items():
73-
tags_temp = [tag for tag in tags if
74-
is_VDLRecord_file(path=bfile.join(run, tag), check=False)]
75-
tags_temp.sort(reverse=True)
76-
if len(tags_temp) > 0:
77-
walks_temp.update({run: tags_temp[0]})
72+
for run, tags in walks.items():
73+
tags_temp = [tag for tag in tags if
74+
is_VDLRecord_file(path=bfile.join(run, tag), check=False)]
75+
tags_temp.sort(reverse=True)
76+
if len(tags_temp) > 0:
77+
walks_temp.update({run: tags_temp[0]})
7878

7979
return walks_temp
8080

0 commit comments

Comments
 (0)