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:
commit
17bdcf00b0
6
plug.py
6
plug.py
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user