add docs and a cli flag for testing adm-zip dependency updates (#4949)
* add docs and a cli flag for testing adm-zip dependency updates Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
This commit is contained in:
Родитель
a4a5c5bdd0
Коммит
c5512aaa93
|
@ -284,5 +284,13 @@ Monitor provides a tool for sending test email at the endpoint `/admin/emails`.
|
|||
|
||||
### `adm-zip`
|
||||
|
||||
This is used as part of downloading and unzipping location data for the auto-complete address feature.
|
||||
|
||||
Normally this is run by cron and uploads to an S3 bucket, the upload step can be skipped with:
|
||||
|
||||
```sh
|
||||
npm run create-location-data -- --skip-upload
|
||||
```
|
||||
|
||||
TODO: Describe how to verify that uploading auto-complete locations still works
|
||||
as expected.
|
||||
|
|
|
@ -22,7 +22,6 @@ import {
|
|||
rmSync,
|
||||
writeFileSync,
|
||||
} from "fs";
|
||||
import { uploadToS3 } from "../../utils/s3.js";
|
||||
import Sentry from "@sentry/nextjs";
|
||||
import os from "os";
|
||||
import path from "path";
|
||||
|
@ -325,7 +324,13 @@ try {
|
|||
writeFileSync(LOCATIONS_DATA_FILE, JSON.stringify(locationDataFinal));
|
||||
|
||||
let readStream = fs.createReadStream(LOCATIONS_DATA_FILE);
|
||||
await uploadToS3(`autocomplete/${LOCATIONS_DATA_FILE}`, readStream);
|
||||
|
||||
if (process.argv.includes("--skip-upload")) {
|
||||
console.debug("Skipping S3 upload");
|
||||
} else {
|
||||
const uploadToS3 = await import("../s3.js");
|
||||
await uploadToS3(`autocomplete/${LOCATIONS_DATA_FILE}`, readStream);
|
||||
}
|
||||
|
||||
if (CLEANUP_TMP_DATA_AFTER_FINISHED) {
|
||||
console.info("Cleaning up data directory");
|
||||
|
|
Загрузка…
Ссылка в новой задаче