小编nap*_*apo的帖子

promise.all在forEach循环中 - 一切都在触发

在Node应用程序中,我需要以同步方式迭代某些项,但循环内的一些操作是异步的.我的代码现在看起来像这样:

someAPIpromise().then((items) => {
   items.forEach((item) => {
      Promise.all[myPromiseA(item), myPromiseB(item)]).then(() => {
         doSomethingSynchronouslyThatTakesAWhile();
      });
    }
}
Run Code Online (Sandbox Code Playgroud)

items数组为1 时,这会产生奇迹.但是,一旦有多个项目,promise.all()就会立即为数组中的每个项目启动,而不必等待循环中的操作结束.

所有这些......我怎样才能确保数组中每个项的整个操作是同步运行的(即使某些操作是异步并返回一个promise)?

非常感谢!

ñ

javascript asynchronous node.js promise es6-promise

6
推荐指数
1
解决办法
5020
查看次数

无法通过Fastlane Pilot提交TestFlight构建

上传一个应用程序并提交给FastLlane deliver我进行审核后,我正试图启动内部测试pilot.但是,只要我使用如下命令执行此操作:

pilot distribute -a com.foo.bar.awesomesauce -u me@example.com -w test_test_test
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Error finding relevant GitHub issues: undefined method `map' for nil:NilClass

[!] The request could not be completed because:
    Beta App Description is required. The phone number is missing. The email must be in the format: contact@example.com. The email is required. Beta App Description is required. The email must be in the format: contact@example.com. The email is required. The phone number is missing. Validation errors
Run Code Online (Sandbox Code Playgroud)

例外是不言而喻的,跳入iTunes …

itunesconnect ios testflight fastlane fastlane-deliver

5
推荐指数
1
解决办法
744
查看次数