better time usings
This commit is contained in:
@@ -6,7 +6,7 @@ on serialization, validation, and OpenAPI documentation.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
|
||||
@@ -80,8 +80,8 @@ class DownloadItem(BaseModel):
|
||||
|
||||
# Timestamps
|
||||
added_at: datetime = Field(
|
||||
default_factory=datetime.utcnow,
|
||||
description="When item was added to queue"
|
||||
default_factory=lambda: datetime.now(timezone.utc),
|
||||
description="When item was added to queue",
|
||||
)
|
||||
started_at: Optional[datetime] = Field(
|
||||
None, description="When download started"
|
||||
|
||||
Reference in New Issue
Block a user