Explorar el Código

Merge pull request #64 from ChlodAlejandro/python3

Parse string-type datetime in checker
pull/65/head
Ben Kurtovic hace 5 meses
committed by GitHub
padre
commit
b7bb289c30
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: B5690EEEBB952194
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. +5
    -1
      src/copyvios/checker.py

+ 5
- 1
src/copyvios/checker.py Ver fichero

@@ -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):


Cargando…
Cancelar
Guardar