Skip to content

Commit fdcd0f0

Browse files
author
Maciej Wilczyński
committed
Add architecture to requirements layer cache archive file name
1 parent c23977f commit fdcd0f0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/layer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ function zipRequirements() {
1818
const zipCachePath = getRequirementsLayerPath(
1919
reqChecksum,
2020
targetZipPath,
21-
this.options
21+
this.options,
22+
this.serverless
2223
);
2324

2425
const promises = [];

lib/shared.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ function getRequirementsWorkingPath(
8989
function getRequirementsLayerPath(
9090
hash,
9191
fallback,
92-
options
92+
options,
93+
serverless,
9394
) {
9495
// If we want to use the static cache
9596
if (hash && options && options.useStaticCache) {
96-
hash = hash + '_slspyc.zip';
97+
const architecture = serverless.service.provider.architecture || 'x86_64';
98+
hash = `${hash}_${architecture}_slspyc.zip`;
9799
return path.join(getUserCachePath(options), hash);
98100
}
99101

0 commit comments

Comments
 (0)