问题
Environment:
Windows 10
Command prompt
Why is only the first lambda update running in my batch file? Is this an asynchronous issue?
script.bat
...
aws lambda update-function-code --function-name "fx1" --zip-file fileb://zip1.zip
aws lambda update-function-code --function-name "fx2" --zip-file fileb://zip2.zip
回答1:
Assuming, aws
is a batchfile:
When you execute another batchfile (B) from a batchfile (A), you transfer control from (A) to (B) and if (B) ends, there is no "return" to (A).
When you call the batchfile (B), (A) is paused until (B) finishes; Control is given back to (A) and (A) proceeds with the next line.
So you shouldn't execute aws:
aws lambda update-function-code --function-name "fx1" --zip-file fileb://zip1.zip
but call it:
call aws lambda update-function-code --function-name "fx1" --zip-file fileb://zip1.zip
来源:https://stackoverflow.com/questions/51435269/only-first-lambda-update-statement-is-running-in-my-batch-file