Piotr Domański
e2af49046c
All checks were successful
Python lint and test / linttest (push) Successful in 5m30s
14 lines
490 B
Python
14 lines
490 B
Python
from fastapi import HTTPException
|
|
|
|
from ..domain.product import Product as DBProduct
|
|
from .base import TasksSessionController
|
|
|
|
|
|
class CacheProductUsageData(TasksSessionController):
|
|
async def call(self) -> None:
|
|
async with self.async_session.begin() as session:
|
|
try:
|
|
await DBProduct.cache_usage_data(session)
|
|
await session.commit()
|
|
except Exception as e:
|
|
raise HTTPException(status_code=400, detail=str(e))
|