Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
farizrahman4u committed Sep 12, 2020
1 parent f31ca84 commit 48fd114
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wandb/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,8 +1362,12 @@ def gc(ctx, keep):
dates = []
for p in paths:
try:
dates.append(datetime.datetime.strptime(os.path.basename(p).split("-")[1], "%Y%m%d_%H%M%S"))
except:
dates.append(
datetime.datetime.strptime(
os.path.basename(p).split("-")[1], "%Y%m%d_%H%M%S"
)
)
except Exception:
pass
since = datetime.datetime.now() - datetime.timedelta(hours=keep)
bad_paths = [paths[i] for i, d in enumerate(dates) if d < since]
Expand Down

0 comments on commit 48fd114

Please sign in to comment.