下面代码中的第二行在云作业期间没有执行,为什么会出现这种情况?前一行运行良好。
Parse.Object.destroyAll(apples).then(function() {
return Parse.Object.destroyAll(pears); //Destroy all pear objects.
}, function(error) {
status.error("Failed to destroy all apples/pears.");
});
status.success("Successfully deleted " + results.length + " pears.");
最佳答案
您的 status.success
在 destroyAll(pears) 甚至有机会运行之前同步运行
试试这个方法
Parse.Object.destroyAll(apples).then(function() {
return Parse.Object.destroyAll(pears); //Destroy all pear objects.
}).then(function() {
status.success("Successfully deleted " + results.length + " pears.");
}, function(error) {
status.error("Failed to destroy all apples/pears.");
});
关于javascript - 解析 Promise,destroyAll();不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31487875/