diff --git a/main.ipynb b/main.ipynb index c546518..ad328d4 100644 --- a/main.ipynb +++ b/main.ipynb @@ -480,7 +480,7 @@ "outputs": [], "source": [ "@app.get(\"/cron/08\", response_model=dict)\n", - "async def cron_08():\n", + "async def cron_08(background_tasks: BackgroundTasks):\n", " async for doc in posts_collection.find({\n", " '_id': {'$gte': ObjectId.from_datetime(datetime.now() - timedelta(days=1))},\n", " '$or':[{'vk':[]},{'tg':[]},{'fb':[]},{'inst':[]},{'max':[]}]\n", diff --git a/main.py b/main.py index b75fb5e..cd32f21 100644 --- a/main.py +++ b/main.py @@ -303,7 +303,7 @@ async def posts_temp(user,request): ) @app.get("/cron/08", response_model=dict) -async def cron_08(): +async def cron_08(background_tasks: BackgroundTasks): async for doc in posts_collection.find({ '_id': {'$gte': ObjectId.from_datetime(datetime.now() - timedelta(days=1))}, '$or':[{'vk':[]},{'tg':[]},{'fb':[]},{'inst':[]},{'max':[]}]