From 726b751c4ecf3026c105e061255ac1fc0b8a6898 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Fri, 29 Dec 2023 20:54:50 +0800 Subject: [PATCH] update --- deploy/docker-compose.yml | 4 ++-- pdm.lock | 25 ++++++++++++++++++++++++- pyproject.toml | 1 + requirements.txt | 2 ++ server/celery_app.py | 1 + server/tasks/__init__.py | 3 ++- server/tasks/lark.py | 2 +- 7 files changed, 33 insertions(+), 5 deletions(-) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 3a55721e..73389028 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -33,8 +33,8 @@ services: - ./data/mysql/data:/var/lib/mysql - ./data/mysql/conf.d:/etc/mysql/conf.d environment: - MYSQL_ROOT_PASSWORD: 'gitmaya' - MYSQL_DATABASE: 'gitmaya2023' + MYSQL_ROOT_PASSWORD: 'gitmaya2023' + MYSQL_DATABASE: 'gitmaya' TZ: 'Asia/Shanghai' ports: - "3306" diff --git a/pdm.lock b/pdm.lock index a4341bdb..65979d9a 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default"] strategy = ["cross_platform"] lock_version = "4.4" -content_hash = "sha256:03abf006ee3055e53a3a12c9933c85107a2fc0de61462e96e18b1327f85c3866" +content_hash = "sha256:6aad74a90f0ad95144d877dcf48c872ce82df2a6ddbe42d04e67585c0734c5f8" [[package]] name = "amqp" @@ -36,6 +36,16 @@ files = [ {file = "anyio-4.2.0.tar.gz", hash = "sha256:e1875bb4b4e2de1669f4bc7869b6d3f54231cdced71605e6e64c9be77e3be50f"}, ] +[[package]] +name = "async-timeout" +version = "4.0.3" +requires_python = ">=3.7" +summary = "Timeout context manager for asyncio programs" +files = [ + {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, + {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, +] + [[package]] name = "billiard" version = "4.2.0" @@ -591,6 +601,19 @@ files = [ {file = "python_dotenv-1.0.0-py3-none-any.whl", hash = "sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a"}, ] +[[package]] +name = "redis" +version = "5.0.1" +requires_python = ">=3.7" +summary = "Python client for Redis database and key-value store" +dependencies = [ + "async-timeout>=4.0.2; python_full_version <= \"3.11.2\"", +] +files = [ + {file = "redis-5.0.1-py3-none-any.whl", hash = "sha256:ed4802971884ae19d640775ba3b03aa2e7bd5e8fb8dfaed2decce4d0fc48391f"}, + {file = "redis-5.0.1.tar.gz", hash = "sha256:0dab495cd5753069d3bc650a0dde8a8f9edde16fc5691b689a566eda58100d0f"}, +] + [[package]] name = "six" version = "1.16.0" diff --git a/pyproject.toml b/pyproject.toml index 11d48a50..52ec8545 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ dependencies = [ "urllib3>=2.1.0", "ca-lark-sdk>=0.0.8", "celery>=5.3.6", + "redis>=5.0.1", ] requires-python = ">=3.10" readme = "README.md" diff --git a/requirements.txt b/requirements.txt index dd441b2c..97cff15e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ amqp==5.2.0 anyio==4.2.0 +async-timeout==4.0.3; python_full_version <= "3.11.2" billiard==4.2.0 blinker==1.7.0 bson==0.5.10 @@ -38,6 +39,7 @@ pycryptodome==3.19.1 pymysql==1.1.0 python-dateutil==2.8.2 python-dotenv==1.0.0 +redis==5.0.1 six==1.16.0 sniffio==1.3.0 sqlalchemy==2.0.23 diff --git a/server/celery_app.py b/server/celery_app.py index 36419779..5b6f046f 100644 --- a/server/celery_app.py +++ b/server/celery_app.py @@ -1,3 +1,4 @@ +import env from app import app from celery import Celery diff --git a/server/tasks/__init__.py b/server/tasks/__init__.py index 9e600514..5b2395dd 100644 --- a/server/tasks/__init__.py +++ b/server/tasks/__init__.py @@ -1,4 +1,5 @@ -from ..celery_app import celery +from celery_app import celery + from .lark import test_task celery.conf.beat_schedule = { diff --git a/server/tasks/lark.py b/server/tasks/lark.py index 88de897a..c0e094dc 100644 --- a/server/tasks/lark.py +++ b/server/tasks/lark.py @@ -1,4 +1,4 @@ -from ..celery_app import celery +from celery_app import celery @celery.task()