每次文件更改时,App Engine 本地开发服务器都会重新加载 - 这很酷。不酷的是,它还会在 PyCharm 编辑器的 .idea 文件夹中重新加载更改,使日志混乱。尝试将其添加到app.yaml
:
skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?..*$
- ^.idea$ # added this line in order to try and ignore .idea folder on build
这无济于事。每次我在编辑器中执行任意操作时(不更改任何代码)时,仍然会重建。
如何告诉 App Engine 开发服务器在热重载时要忽略哪个文件夹?
dev_appserver.py --help
提到:
--watcher_ignore_re WATCHER_IGNORE_RE
Regex string to specify files to be ignored by the
filewatcher. (default: None)
在这种情况下,这与dev_appserver.py
有关,它将检测本地app.yaml
的变化并重新加载本地服务器,而不应该在 GAE 中运行app.yaml
,因为重新加载是由gcloud app deploy
完成的。