Skip to content

Commit fe45ac1

Browse files
committed
Fix tippecanoe architecture
1 parent 694d80d commit fe45ac1

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed
-23.6 MB
Binary file not shown.

backend/serverless.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ functions:
109109
events:
110110
- schedule: cron(10 12 * * ? *)
111111
timeout: 900
112+
memorySize: 4096
112113
layers:
113114
- Ref: TippecanoeLambdaLayer
114115
generateStoryTitles:

backend/src/business/utils/tippecanoe.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,11 @@ export default async function tippecanoe(
107107
}
108108
}
109109

110+
// Use tippecanoe command (available in PATH via Lambda layer)
111+
const tippecanoePath = 'tippecanoe';
112+
110113
// Spawn tippecanoe process
111-
const tippecanoeProcess = spawn('tippecanoe', args, {
114+
const tippecanoeProcess = spawn(tippecanoePath, args, {
112115
stdio: ['pipe', 'pipe', 'pipe'],
113116
});
114117

@@ -127,11 +130,14 @@ export default async function tippecanoe(
127130
reject(new Error(`Tippecanoe process error: ${error.message}`));
128131
});
129132

130-
tippecanoeProcess.on('exit', (code) => {
133+
tippecanoeProcess.on('exit', (code, signal) => {
131134
if (code === 0) {
132135
resolve();
133136
} else {
134-
reject(new Error(`Tippecanoe exited with code ${code ?? 'unknown'}`));
137+
const errorMsg = `Tippecanoe exited with code ${code ?? 'unknown'}${
138+
signal ? ` (signal: ${signal})` : ''
139+
}`;
140+
reject(new Error(errorMsg));
135141
}
136142
});
137143
});

backend/tippecanoe-layer.zip

89.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)