File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ sendRuntimeError () {
2828# Send successful response to Lambda API
2929sendResponse () {
3030 REQUEST_ID=$1
31- RESPONSE =$2
32- curl -sS -X POST -d " $RESPONSE " " http://${AWS_LAMBDA_RUNTIME_API} /${RUNTIME_PATH} /invocation/${REQUEST_ID} /response" > /dev/null
31+ REQUEST_RESPONSE =$2
32+ curl -sS -X POST -d " $REQUEST_RESPONSE " " http://${AWS_LAMBDA_RUNTIME_API} /${RUNTIME_PATH} /invocation/${REQUEST_ID} /response" > /dev/null
3333}
3434
3535# Make sure handler file exists
5858# Processing
5959while true
6060do
61- HEADERS=" $( mktemp) "
62- RESPONSE=" $( mktemp) "
61+ HEADERS=" /tmp/headers-$( date +' %s' ) "
62+ RESPONSE=" /tmp/response-$( date +' %s' ) "
63+ touch $HEADERS
64+ touch $RESPONSE
6365 EVENT_DATA=$( curl -sS -LD " $HEADERS " -X GET " http://${AWS_LAMBDA_RUNTIME_API} /${RUNTIME_PATH} /invocation/next" )
6466 REQUEST_ID=$( grep -Fi Lambda-Runtime-Aws-Request-Id " $HEADERS " | tr -d ' [:space:]' | cut -d: -f2)
6567 # Export some additional context
8183 # Clean up
8284 rm -f -- " $HEADERS "
8385 rm -f -- " $RESPONSE "
86+ unset HEADERS
87+ unset RESPONSE
8488done
You can’t perform that action at this time.
0 commit comments