jeremydaly / lambda-warmer

A module to optimize AWS Lambda function cold starts
MIT License
525 stars 55 forks source link

lastAccessed field in log may be incorrect #11

Closed msmolens closed 4 weeks ago

msmolens commented 5 years ago

Expected behavior

The lastAccessed field in the log is the timestamp of when the function was last accessed by a non-warming event.

Actual behavior

The lastAccessed field in the log may be the timestamp of when the function was last accessed by a warming event; it's updated when processing warming events: https://github.com/jeremydaly/lambda-warmer/blob/de1ffe85949fdd37b909a4a8c82e3e5e352bf153/index.js#L67

Details

As the documentation states, the lastAccessed field, along with lastAccessedSeconds, can help determine if the concurrency can be lowered. However, if lastAccessed is updated when processing warming events, then it cannot be used for that purpose.

This behavior was introduced in #6.