小编scū*_*lus的帖子

在 docker-compose.yml 中设置健康检查的“开始间隔”

我正在使用 Docker Compose 部署一些服务。我想检查我的容器是否运行正常(请参阅此处的healthcheckDocker Compose 文档)。

\n

让我们考虑以下代码。它工作正常,除非我取消注释最后一行:

\n
# docker-compose.yml\n\nversion: "3.8"\n\nservices:\n  postgres:    # this is just an example, please don\'t focus on that particular image\n    image: postgres:15-alpine\n    healthcheck:\n      test: pg_isready -d my_db -U my_user    # again, the command here is not my point, nor the env, feel free to change it\n      interval: 60s\n      start_period: 30s\n      # start_interval: 5s # \xe2\x86\x92 this line is commented because it raises an error! Why?\n
Run Code Online (Sandbox Code Playgroud)\n

Dockerfile 文档的此页面描述了指令中各种设置之间的差异HEALTHCHECK。 …

docker docker-compose health-check docker-healthcheck

10
推荐指数
1
解决办法
3080
查看次数

Python 类型提示中的“at”符号 (@)(由 Pylance / Pyright 建议)

2022 年 7 月发布的Visual Studio Code Python 扩展引入了“ Inlay Type Hints ”,它会自动建议没有显式注释的函数的返回类型。要启用它,您可以设置"python.analysis.inlayHints.functionReturnTypes": trueIDE 用户设置(首选项:打开设置 (JSON) 命令)。

在测试此功能时,我注意到类中存在以下建议: 在此输入图像描述

...其中黄色突出显示的文本是 Python 扩展建议的返回类型,该扩展基于Pylance,而 Pylance 本身又依赖于Pyright

我的问题是:@这个建议中的标志是什么意思?是否有 PEP 引用这种类型注释(使用Self@...),或者这种类型提示特定于Pyright,与标准约定不同?我在哪里可以找到更多相关信息?

我在这里发现了一个类似的 Stackoverflow 问题,但没有得到任何答案。

python type-hinting visual-studio-code pyright pylance

9
推荐指数
1
解决办法
534
查看次数