Can't cache python requirements due to updated last modification time
dongho-jung opened this issue · 1 comments
as the title suggests, python requirements aren't being cached due to updated last modification time.
serverless-python-requirements can cache python requirements with lambda layer.
but in some cases, it can't.
I've investigated this issue for several days:
- serverless says the hash of new pythonRequirements.zip is different with the hash of one in S3, so it should be uploaded again
- however, when I compare all the files in local pythonRequirements.zip and S3 pythonRequirements.zip, their contents are all the same
- finally found that, the last modification time of files is different..
this issue is mentioned before though, the problem is still exist.
In code, I think below snippet should fix this issue, but it couldn't its job.
serverless-python-requirements/lib/zipTree.js
Lines 74 to 75 in ebd12cb
and I also found that it seems below snippet broke caching
serverless-python-requirements/lib/pip.js
Lines 664 to 665 in ebd12cb
I don't know what the FIFO cache is in this context... but after I comment these lines out, the cache works like a charm.
please any comment on this. thanks
nevermind. I was using 5.1.1 and I updated to 5.4.0 and the issue is gone. sorry for inappropriate issue.