소스 검색

fix no such method

Daniel Sheffield 1 년 전
부모
커밋
d24e4057d9
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      app/rest/Cache.py

+ 2 - 2
app/rest/Cache.py

@@ -4,7 +4,7 @@
 #
 # THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY
 import os
-import time
+from time import time
 from typing import Dict
 
 from .hash_util import blake, bytes_to_hash, hash_to_base32
@@ -41,7 +41,7 @@ def get_page(name: str, root: str = 'app/rest/static/files') -> str:
     except:
         mtime = None
     
-    if mtime and time.now() - mtime > STALE:
+    if mtime and time() - mtime > STALE:
         delete_page(name)
         return None