I am new programing with lambda functions. After some research this seems to be a general problem with aws lambda functions sometimes (and this is where I don’t know how to start debugging) While calling one of my function, I noticed it is executed twice.
I’m using these functions as a login (first function) and callback (second) for an auth2 authent.
The problem here is that I’m generating a random state token and storing it in mongoDB, this works fine but since it creates two tokens, I can only delete one after using it.
At first I thought it was because of “OPTIONS”, but I noticed this behaviour was rather random. Judging by the logs I can’t see anything abnormal besides the double exec :
11:13:04 AM: New state token generatedTHis was called from : GET 11:13:04 AM: Duration: 2256.36 ms Memory Usage: 51 MB Init Duration: 214.05 ms 11:13:06 AM: New state token generatedTHis was called from : GET 11:13:06 AM: Duration: 2046.06 ms Memory Usage: 51 MB
Any light on this issue would be appreciated !