Skip to content

Commit 35de827

Browse files
committed
Use ISO string and add comment
1 parent 056381e commit 35de827

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

backend/src/cron/syncMapSelfHosted.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default async function syncMap(): Promise<void> {
3636
console.log('Uploading PMTiles to S3...');
3737
const pmtilesStream = createReadStream(result.outputPath);
3838

39-
const key = `photos-1940s_${Date.now()}.pmtiles`;
39+
const key = `photos-1940s_${new Date().toISOString()}.pmtiles`;
4040

4141
await s3.send(
4242
new PutObjectCommand({
@@ -48,6 +48,10 @@ export default async function syncMap(): Promise<void> {
4848
})
4949
);
5050

51+
// Setup, this specifies a redirect from photos-1940s_latest.pmtiles to the actual latest file
52+
// Website mode isn't appropriate for this bucket due to permissioning, which is required to respect this header,
53+
// so there's a Lambda@Edge that actually does the redirect based on the same website redirect header
54+
5155
await s3.send(
5256
new PutObjectCommand({
5357
Bucket: 'fourties-maps',

0 commit comments

Comments
 (0)