1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-22 20:00:29 +03:00

Merge pull request #2385 from Balvald/skip_timecheck_fix

Fix Timechecker on develop
This commit is contained in:
David Sangrey 2025-03-06 00:07:38 +00:00 committed by GitHub
commit 17bdcf00b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ import operator
import os
import sys
import tkinter as tk
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from pathlib import Path
from tkinter import ttk
from typing import Any, Mapping, MutableMapping
@ -335,8 +335,8 @@ def notify_journal_entry(
if "timestamp" in entry and not config.skip_timecheck:
# Check that timestamp is recent enough
dt = datetime.strptime(entry["timestamp"], "%Y-%m-%dT%H:%M:%SZ")
if dt > datetime.utcnow() - timedelta(minutes=60):
dt = datetime.strptime(entry["timestamp"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)
if dt < datetime.now(timezone.utc) - timedelta(minutes=60):
error = f"Event at {entry['timestamp']} beyond Time Delta of 60 minutes. Skipping."
return error