feat: switch all timezone naive datetimes to timezone aware
This commit is contained in:
parent
41fc0a73a5
commit
e22abb383c
30 changed files with 322 additions and 226 deletions
|
@ -1,9 +1,9 @@
|
|||
from collections import defaultdict
|
||||
from datetime import datetime, timedelta
|
||||
import fnmatch
|
||||
import logging
|
||||
from abc import abstractmethod
|
||||
import fnmatch
|
||||
from typing import Tuple, List, Any, Optional, Dict
|
||||
from collections import defaultdict
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from app.extensions import db
|
||||
from app.models.activity import Activity
|
||||
|
@ -41,7 +41,7 @@ class BlockMirrorAutomation(BaseAutomation):
|
|||
if not proxy.origin.auto_rotation:
|
||||
logging.debug("Proxy auto-rotation forbidden for origin")
|
||||
continue
|
||||
if proxy.added > datetime.utcnow() - timedelta(hours=3):
|
||||
if proxy.added > datetime.now(tz=timezone.utc) - timedelta(hours=3):
|
||||
logging.debug("Not rotating a proxy less than 3 hours old")
|
||||
continue
|
||||
if proxy.deprecate(reason=f"block_{source}"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue