Skip to content

Conversation

@zx900930
Copy link

@zx900930 zx900930 commented Jul 13, 2024

PR for #801

新增api

  • GET /health
  • PATCH /health

新增module
health.py

引用module.checker.check_downloader() 检查下载客户端连接情况
在module.network.request_url.RequestURL 内新增 change_health_status() 请求根据get_url 和 post_url 返回结果修改当前的健康状况

测试用镜像
image: triatk/auto_bangumi:dev-healthcheck-v1.1.9

备注:

  1. 默认设置下容器被标记为unhealthy不会重启,除非使用的是docker swarm。
  2. k8s环境下可以用作liveness 和 readiness probe使用。
  3. 可以使用如下docker compose自动重启unhealthy的容器:
version: '3'
services:
  autoheal:
    image: willfarrell/autoheal
    container_name: autoheal
    restart: always
    environment:
      - AUTOHEAL_CONTAINER_LABEL=all
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

@vercel
Copy link

vercel bot commented Jul 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auto-bangumi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2024 9:54am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant