gpt4 book ai didi

google-app-engine - appengine 上的异步/等待

转载 作者:行者123 更新时间:2023-12-02 05:12:24 29 4
gpt4 key购买 nike

当我使用异步等待方法时,我在 google dart appengine 上收到以下错误,我们如何在应用程序引擎上使用异步等待?

INFO: Creating container... INFO: Container
e40102016036bcc2bc36a3b4f5a39c2c427a107e8ead3f86d025cdce950e25af
created. DEBUG: Container: e40102016036: Observatory listening on
http://a.domain:8181 DEBUG: Container: e40102016036:
'package:forcemvc/server/serving_files.dart': error: line 46 pos 71:
use flag --enable-async to enable async/await features Future
serveFile(HttpRequest request, String root, String fileName) async { ^
DEBUG: Automatic cleanup... DEBUG: Cleanup finished. INFO: default:
"GET /_ah/health?IsLastSuccessful=no HTTP/1.1" 503 - DEBUG: Health
check response [''] and status 503 Service Unavailable for instance 0.
DEBUG: Health check state for instance: 0: 3 consecutive UNHEALTHY
responses. DEBUG: Performing health check for instance 0.

最佳答案

--enable-async 添加到 DART_VM_OPTIONS 环境变量。
您可以使用 app.yaml 文件进行设置,例如:

env_variables:
DART_VM_OPTIONS: '--enable-async'

您可能需要更新到最新的 Dart Docker 镜像(例如 google/dart-runtime - 4 小时前更新)

关于google-app-engine - appengine 上的异步/等待,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27255876/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com