fix: use naive UTC datetimes for TIMESTAMP WITHOUT TIME ZONE columns
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"""Equipment sync service: import from Rentman, upsert into DB, invalidate cache."""
|
"""Equipment sync service: import from Rentman, upsert into DB, invalidate cache."""
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
@@ -32,7 +32,7 @@ class SyncService:
|
|||||||
log_entry = SyncLog(
|
log_entry = SyncLog(
|
||||||
sync_type="equipment",
|
sync_type="equipment",
|
||||||
status="running",
|
status="running",
|
||||||
started_at=datetime.now(timezone.utc),
|
started_at=datetime.utcnow(),
|
||||||
)
|
)
|
||||||
self.db.add(log_entry)
|
self.db.add(log_entry)
|
||||||
await self.db.commit()
|
await self.db.commit()
|
||||||
@@ -70,7 +70,7 @@ class SyncService:
|
|||||||
log_entry.items_processed = items_processed
|
log_entry.items_processed = items_processed
|
||||||
log_entry.items_failed = items_failed
|
log_entry.items_failed = items_failed
|
||||||
log_entry.error_message = error_message
|
log_entry.error_message = error_message
|
||||||
log_entry.completed_at = datetime.now(timezone.utc)
|
log_entry.completed_at = datetime.utcnow()
|
||||||
await self.db.commit()
|
await self.db.commit()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user