소스 검색

Merge pull request #64 from ChlodAlejandro/python3

Parse string-type datetime in checker
pull/65/head
Ben Kurtovic 5 달 전
committed by GitHub
부모
커밋
b7bb289c30
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일과 5개의 추가작업 그리고 1개의 파일을 삭제
  1. +5
    -1
      src/copyvios/checker.py

+ 5
- 1
src/copyvios/checker.py 파일 보기

@@ -229,7 +229,11 @@ def _get_cached_results(
return None

if not isinstance(cache_time, datetime):
cache_time = datetime.fromtimestamp(cache_time, tz=UTC)
if isinstance(cache_time, (int, float)):
cache_time = datetime.fromtimestamp(cache_time, tz=UTC)
else:
# Y-M-D H:M:S
cache_time = datetime.strptime(cache_time, "%Y-%m-%d %H:%M:%S").replace(tzinfo=UTC)
elif cache_time.tzinfo is None:
cache_time = cache_time.replace(tzinfo=UTC)
if datetime.now(UTC) - cache_time > timedelta(days=3):


불러오는 중...
취소
저장