0 votes
1 view
in AWS by (19.2k points)

For instance:

count = 0

        while True:


                if count == 5:


                snap = ec.create_snapshot(





            except Exception as e:



                count = count + 1

So If I have a lot of instances and errors then it could be a long time of running lambda. What could be alternative to put Lambda to sleep?

1 Answer

0 votes
by (44.5k points)

You will still be charged. So you will pay them for the time a function takes to complete its execution or when you have the set the timeout. Calling sleep() won’t stop the execution of the function, so you will still be charged for that time too. Make sure, you stop your function after your functions task completes and set the function timeout accordingly.

Related questions

0 votes
2 answers
asked Jul 26, 2019 in AWS by yuvraj (19.2k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !