diff --git a/.drone.yml b/.drone.yml index 8b8fc11..f8362fd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,19 +34,19 @@ steps: image: appleboy/drone-ssh settings: host: - - 148.135.109.242 - username: root + - 8.134.220.69 + username: ching key: from_secret: ssh_key passphrase: from_secret: ssh_passphrase - port: 22 + port: 45348 command_timeout: 2m script: - echo "Pull new image" - docker pull git.tunpok.com/ching/grocy-barcode-helper:latest - echo "Go to the project directory" - - cd /root/develop/grocy-barcode-helper + - cd /home/ching/dev/grocy-barcode-helper - echo "Restart the container" - docker-compose down && docker-compose up -d diff --git a/app.py b/app.py index 1301ddb..782f8d1 100644 --- a/app.py +++ b/app.py @@ -371,7 +371,7 @@ create_consumer_group() def consume_stream(): try: # 读取 Stream 中的消息,设置阻塞时间为 0 - messages = r.xreadgroup(CONSUMER_GROUP, CONSUMER_NAME, {STREAM_KEY: '>'}, count=5, block=1000) + messages = r.xreadgroup(CONSUMER_GROUP, CONSUMER_NAME, {STREAM_KEY: '>'}, count=10, block=1000) if messages: for stream, msgs in messages: @@ -392,7 +392,7 @@ def consume_stream(): bark_push('商品添加失败', '条形码 %s' % msg['data']) except Exception as e: - print(f"Error consuming stream: {e}") + logger.exception(f"Error processing messages: {str(e)}") # TODO: 定时任务函数:从 Redis Stream 读取消费者组的未确认消息