From d6999e4e5ecd0055d21e233deb8cd1e341e32725bf8ac218b06c1934d2b390a3 Mon Sep 17 00:00:00 2001 From: Vladislav Date: Mon, 20 Jul 2026 14:34:08 -0400 Subject: [PATCH] fix --- main.ipynb | 23 ++++++++++------------- main.py | 1 - vk.ipynb | 42 ++++++++++++++++++++++++++++++++++++------ vk.py | 4 ++-- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/main.ipynb b/main.ipynb index 97ed56f..444958f 100644 --- a/main.ipynb +++ b/main.ipynb @@ -602,7 +602,6 @@ " \"post\": post,\n", " **prod_filter\n", " }\n", - " print(new_doc)\n", "\n", " tasks.append(delivery_collection.update_one(\n", " {**prod_filter, \"status\": \"На выставке\", \"post_id\": post_id, \"exhibition_id\": exhibition_id},\n", @@ -4649,22 +4648,16 @@ "cell_type": "code", "execution_count": null, "id": "c7dc7c3e", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, "outputs": [], "source": [ "!uvicorn main:app --host 0.0.0.0 --port 8005 --reload" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "20665cd7", - "metadata": {}, - "outputs": [], - "source": [ - "stop" - ] - }, { "cell_type": "code", "execution_count": null, @@ -4688,7 +4681,11 @@ "cell_type": "code", "execution_count": null, "id": "a6f67f24", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, "outputs": [], "source": [ "!pip freeze > req.txt" diff --git a/main.py b/main.py index e37bdc8..c7472c4 100644 --- a/main.py +++ b/main.py @@ -406,7 +406,6 @@ async def cron_every_five_min(token: str = Security(get_token)): "post": post, **prod_filter } - print(new_doc) tasks.append(delivery_collection.update_one( {**prod_filter, "status": "На выставке", "post_id": post_id, "exhibition_id": exhibition_id}, diff --git a/vk.ipynb b/vk.ipynb index e6685a0..ab4df6e 100644 --- a/vk.ipynb +++ b/vk.ipynb @@ -392,7 +392,7 @@ " try:\n", " logging.info(f\"VK начало edit {item} {file_ids}\")\n", " res = httpx.post(\n", - " 'http://kultmost-api.kultmost/api/v1/social/vk/edit', \n", + " 'http://127.0.0.1:30080/api/v1/social/vk/edit', \n", " headers={\"Authorization\": f\"bearer {ATOKEN}\"}, \n", " json={'post_id': post_id, 'item': item, 'text': text, 'file_ids': file_ids, 'doc': social, 'sign_avatar': sign_avatar},\n", " timeout=100\n", @@ -427,7 +427,7 @@ " try:\n", " logging.info(f\"VK удаления публикации {item} {post_id}\")\n", " res = httpx.post(\n", - " 'http://kultmost-api.kultmost/api/v1/social/vk/delete',\n", + " 'http://127.0.0.1:30080/api/v1/social/vk/delete',\n", " headers={\"Authorization\": f\"bearer {ATOKEN}\"},\n", " json={'item': item, 'post_id': post_id, \"doc\": doc},\n", " timeout=100\n", @@ -541,7 +541,11 @@ "cell_type": "code", "execution_count": null, "id": "6f76c7c1", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, "outputs": [], "source": [ "!celery -A vk.celery_app_vk worker --loglevel=info" @@ -551,7 +555,11 @@ "cell_type": "code", "execution_count": null, "id": "b0d41fb5", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, "outputs": [], "source": [ "!docker build -t registry.spiritofweb.ru/avtopost-api:latest ." @@ -561,7 +569,11 @@ "cell_type": "code", "execution_count": null, "id": "674d49e8", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, "outputs": [], "source": [ "!sudo docker image push registry.spiritofweb.ru/avtopost-api:latest" @@ -571,12 +583,30 @@ "cell_type": "code", "execution_count": null, "id": "65b3c103", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, "outputs": [], "source": [ "!kubectl rollout restart deployments/vk-celery -n kultmost" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "79ce5429", + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "!echo $REGISTRY_HOST" + ] + }, { "cell_type": "markdown", "id": "62a866f8", diff --git a/vk.py b/vk.py index 00e802d..afe2239 100644 --- a/vk.py +++ b/vk.py @@ -301,7 +301,7 @@ def edit(self, post_id: int, item: dict, text: str, file_ids: list, social: dict try: logging.info(f"VK начало edit {item} {file_ids}") res = httpx.post( - 'http://kultmost-api.kultmost/api/v1/social/vk/edit', + 'http://127.0.0.1:30080/api/v1/social/vk/edit', headers={"Authorization": f"bearer {ATOKEN}"}, json={'post_id': post_id, 'item': item, 'text': text, 'file_ids': file_ids, 'doc': social, 'sign_avatar': sign_avatar}, timeout=100 @@ -329,7 +329,7 @@ def delete_wall(self, item: dict, post_id: int, doc: dict): try: logging.info(f"VK удаления публикации {item} {post_id}") res = httpx.post( - 'http://kultmost-api.kultmost/api/v1/social/vk/delete', + 'http://127.0.0.1:30080/api/v1/social/vk/delete', headers={"Authorization": f"bearer {ATOKEN}"}, json={'item': item, 'post_id': post_id, "doc": doc}, timeout=100