Explorar el Código

parse string-type datetime in checker

Happens to cause issues when using a SQLite engine.
pull/64/head
Chlod Alejandro hace 5 meses
padre
commit
d324986f66
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: A1E67C59037B0CC1
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