add limit cap and remove unused import

This commit is contained in:
qananasikq
2026-04-16 20:44:27 +03:00
parent f47081d273
commit 47221dc1c8
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
# Роуты запуска задач синхронизации Encar и просмотра истории sync-runs. # Роуты запуска задач синхронизации Encar и просмотра истории sync-runs.
from fastapi import APIRouter, Depends, Query from fastapi import APIRouter, Depends, Query
from pydantic import BaseModel from pydantic import BaseModel, Field
from sqlalchemy import select, func from sqlalchemy import select, func
from ..deps import get_persistence from ..deps import get_persistence
@@ -25,7 +25,7 @@ class SyncListingRequest(BaseModel):
year_to: int | None = None year_to: int | None = None
price_max: int | None = None price_max: int | None = None
lane: str = "encar" lane: str = "encar"
limit: int | None = None limit: int | None = Field(default=None, le=500_000)
@router.post("/tasks/sync-vehicle") @router.post("/tasks/sync-vehicle")

View File

@@ -1,7 +1,7 @@
import json import json
import re import re
from pathlib import Path from pathlib import Path
from typing import Any, Callable, Iterable from typing import Any, Iterable
def save_to_json(data: Any, filename: str | Path) -> None: def save_to_json(data: Any, filename: str | Path) -> None: