Skip to content

Commit 7e8b86c

Browse files
author
Seil Na
authored
오래된 사용내역 삭제, 최대 3일로 조정
1 parent 5949349 commit 7e8b86c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gpustat/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def update_history(gpu_stats):
3939
for gpu_id in history[hostname].keys():
4040
cleaned_users = []
4141
for username, last_used in history[hostname][gpu_id].items():
42-
used_before = (datetime.datetime.now() - last_used['last_used']).seconds / 3600
43-
if used_before > 24 * 7:
44-
# clean use history longer than 7 days
42+
used_before = (datetime.datetime.now() - last_used['last_used']).days
43+
if used_before > 3:
44+
# clean use history longer than 3 days
4545
cleaned_users.append(username)
4646
for username in cleaned_users:
4747
history[hostname][gpu_id].pop(username)

0 commit comments

Comments
 (0)