Skip to content

Commit c709067

Browse files
author
Jim Ng
committed
fix update failure caused by recent AWS changes
(Copied changes from claudiajs#230)
1 parent ce63ec1 commit c709067

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/commands/update.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ module.exports = function update(options, optionalLogger) {
145145
},
146146
() => logger.logStage('waiting for IAM role propagation'),
147147
Promise
148-
);
148+
).then(result => {
149+
logger.logStage('waiting for lambda resource allocation');
150+
return waitUntilNotPending(lambda, lambdaConfig.name, awsDelay, awsRetries)
151+
.then(() => result);
152+
});
149153
}
150154
},
151155
cleanup = function () {

src/tasks/wait-until-not-pending.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const retry = require('oh-no-i-insist');
2-
module.exports = function waitUntilNotPending(lambda, functionName, timeout, retries) {
2+
module.exports = async function waitUntilNotPending(lambda, functionName, timeout, retries) {
33
'use strict';
4+
await new Promise(resolve => setTimeout(resolve, timeout));
5+
46
return retry(
57
() => {
68
return lambda.getFunctionConfiguration({FunctionName: functionName}).promise()
@@ -20,5 +22,3 @@ module.exports = function waitUntilNotPending(lambda, functionName, timeout, ret
2022
Promise
2123
);
2224
};
23-
24-

0 commit comments

Comments
 (0)