私は約束をノードに使用しようとしています。約束を使用することができません
しかし、then部分は実行されていません。 最初の関数はresolve()インスタンスを返します。 これを修正するにはどうすればよいですか?
これはコードです:
exports.refresh_access_token = function (environment_hash) {
...
Model.update(values, {where: where}).then(function() {
console.log('updated!');
resolve("Success!");
}).catch(function (err) {
console.log('error on update');
});
...
}
async.map(accounts, function (account) {
module.exports.refresh_access_token(account.environment_hash).then(function() {
console.log('async called back');
});
}
'最初の関数は(決意を返しますか? –
それは単なる解決( '成功')です。 –
しかし、 '解決'とは何ですか?特別な意味を持たず、あなたのコードに定義されていません –