Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async function set_up_api_server(app) {
return res.sendStatus(404);
}

const gz_image_path = `${screenshot_filename}.gz`;
var gz_image_path = `${screenshot_filename}.gz`;

if (process.env.USE_CLOUD_STORAGE == "true"){
const storage = new Storage();
Expand All @@ -237,6 +237,7 @@ async function set_up_api_server(app) {
res.status(404).send(`Error retrieving image from GCS`);
}
}else{
gz_image_path = `${SCREENSHOTS_DIR}/${gz_image_path}`;
const image_exists = await check_file_exists(gz_image_path);

if(!image_exists) {
Expand Down Expand Up @@ -404,7 +405,7 @@ async function set_up_api_server(app) {
}));
}else{
await Promise.all(screenshots_to_delete.map(screenshot_path => {
return asyncfs.unlink(screenshot_path);
return asyncfs.unlink(`${SCREENSHOTS_DIR}/${screenshot_path}`);
}));
}
const payload_fires = await PayloadFireResults.destroy({
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ services:
volumes:
# Directory where payload fire images are stored.
- ./payload-fire-images:/app/payload-fire-images
- ~/.config/gcloud/application_default_credentials.json:/gcloud.json
depends_on:
postgresdb:
condition: service_healthy
volumes:
- ~/.config/gcloud/application_default_credentials.json:/gcloud.json
postgresdb:
image: postgres
restart: always
Expand Down