I have django script which fetch the data from model.
try:
myuser = MyUser.objects.get(id=user_id)
except Exception as e:
print(e)
# do next process
Then, what I want to do is ,,,
- When database is stopped or not reached, I want to catch and do next process.
However my program return the 502 immediately, because it reachs to the aws lambda's timeout.
2022-06-23 19:09:51 127.0.0.1 - - [23/Jun/2022 19:09:51] "POST /webhook HTTP/1.1" 502 -
Function 'MyDjangoFunction' timed out after 300 seconds
No response from invoke container for MyDjangoFunction
Invalid lambda response received: Lambda response must be valid json
So, my idea is set django - sql timeout shorter.
Is there any good method??