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 () {
28
28
# Send successful response to Lambda API
29
29
sendResponse () {
30
30
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
33
33
}
34
34
35
35
# Make sure handler file exists
58
58
# Processing
59
59
while true
60
60
do
61
- HEADERS=" $( mktemp) "
62
- RESPONSE=" $( mktemp) "
61
+ HEADERS=" /tmp/headers-$( date +' %s' ) "
62
+ RESPONSE=" /tmp/response-$( date +' %s' ) "
63
+ touch $HEADERS
64
+ touch $RESPONSE
63
65
EVENT_DATA=$( curl -sS -LD " $HEADERS " -X GET " http://${AWS_LAMBDA_RUNTIME_API} /${RUNTIME_PATH} /invocation/next" )
64
66
REQUEST_ID=$( grep -Fi Lambda-Runtime-Aws-Request-Id " $HEADERS " | tr -d ' [:space:]' | cut -d: -f2)
65
67
# Export some additional context
81
83
# Clean up
82
84
rm -f -- " $HEADERS "
83
85
rm -f -- " $RESPONSE "
86
+ unset HEADERS
87
+ unset RESPONSE
84
88
done
You can’t perform that action at this time.
0 commit comments