Skip to content

Commit

Permalink
Why are no gpx images created?
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheppner committed Dec 13, 2024
1 parent 32d6a74 commit 08f9fdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/jobs/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,11 @@ export async function syncGPXImage(){
})
}
if(!!toCreate){
// console.log(moment().format('HH:mm:ss'), ' Start to create gpx image files');
console.log(moment().format('HH:mm:ss'), ' Start to create gpx image files');
await createImagesFromMap(toCreate.map(e => e.hashed_url));
}

console.log(`UPDATE tour SET image_url='${getHost("")}/app_static/img/train_placeholder.webp' WHERE image_url IS NULL;`);
await knex.raw(`UPDATE tour SET image_url='${getHost("")}/app_static/img/train_placeholder.webp' WHERE image_url IS NULL;`);
}
return true;
Expand Down
3 changes: 2 additions & 1 deletion src/utils/gpx/gpxUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const createImagesFromMap = async (ids) => {
let url = "";
let dir_go_up = "";
if(process.env.NODE_ENV == "production"){
console.log("process.env.NODE_ENV = ", process.env.NODE_ENV)
dir_go_up = "../../";
url = "https://www.zuugle.at/public/headless-leaflet/index.html?gpx=https://www.zuugle.at/public/gpx/";
addParam.executablePath = path.resolve(__dirname,'../../node_modules/puppeteer/.local-chromium/linux-1022525/chrome-linux/chrome')
Expand Down Expand Up @@ -127,7 +128,7 @@ export const createImagesFromMap = async (ids) => {

if (fs.existsSync(filePathSmallWebp)){
try {
// console.log(moment().format('HH:mm:ss'), ' Gpx image small file created: ' + filePathSmallWebp);
console.log(moment().format('HH:mm:ss'), ' Gpx image small file created: ' + filePathSmallWebp);
await fs.unlink(filePath);
} catch(e){
console.error("gpxUtils error - nothing to delete: ",e);
Expand Down

0 comments on commit 08f9fdf

Please sign in to comment.