2014-12-02 376 views
2

當我使用異步等待方法,我得到谷歌飛鏢appengine以下錯誤,我們如何使用應用程序引擎的異步等待?異步/等待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.

回答

1

--enable-async加到DART_VM_OPTIONS環境變量中。
您可以使用app.yaml文件設爲:

env_variables: 
    DART_VM_OPTIONS: '--enable-async' 

您可能需要更新到最新的飛鏢泊塢窗圖像(例如google/dart-runtime - 更新前4H)

+0

你應該推薦使用等待已構架? – 2014-12-02 20:31:50

+0

您正在討論發佈到pub.dartlang.org?如果你開始一個新的包,我認爲它應該沒問題。確保在你的'pubspec.yaml'中有適當的'environment:'>'sdk:'> = 1.8.0''設置。您應該知道,有幾個團隊不能立即更新到最新版本,因爲他們使用尚未更新的依賴關係或不允許的政治。您必須自己估算您可以節省多少努力,以及有多少潛在用戶尚未能夠使用您的軟件包,如果這能夠實現的話。 – 2014-12-02 21:31:17