Datetime inside lambda giving same time for different invocations.

0

I have a lambda function that writes to dynamodb and inside the lambda, I fetch current time and pass it as well with data as the write time. I have noticed that in the DB, the datetime for the write is same for multiple invocations although they were not together. at least a gap of few minutes was there before each invocation. however, in db, the datetime is the exact including seconds for a few calls that were within a timespan of 15 minutes or so. Can I know why?

질문됨 일 년 전462회 조회
2개 답변
0
수락된 답변

Are you getting the current time inside the handler or outside the handler? The code that runs outside the handler is invoked only once. In your case, you need to do it inside the handler.

If this is not the case, it would be good if you can share your code.

profile pictureAWS
전문가
Uri
답변함 일 년 전
profile pictureAWS
전문가
검토됨 일 년 전
0

Hey, thanks. It's outside the handler. I will put it inside.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠