Making file check more efficent.

This commit is contained in:
Scott Idem
2023-05-26 18:50:52 -04:00
parent fb02fc80a0
commit 99984e7b6c
2 changed files with 61 additions and 10 deletions

View File

@@ -311,7 +311,8 @@ ipcMain.handle('download_file', async (event, api_base_url, api_endpoint, full_s
overwrite_existing = true;
} else {
console.log(`Temp download file has not expired yet. Expire after: ${offset_minutes} minutes`);
return false;
// return false;
return 'tmp';
}
}
if (fs.existsSync(full_save_path)) {
@@ -339,7 +340,8 @@ ipcMain.handle('download_file', async (event, api_base_url, api_endpoint, full_s
console.log('Endpoints in Progress:', endpoints_in_progress);
if (endpoints_in_progress.includes(api_endpoint)) {
console.log(`Endpoint already being downloaded: ${api_endpoint}`);
return false;
// return false;
return 'in_progress';
}
// console.log(`Done with checks. Time to download! Endpoint: ${api_endpoint}`);
endpoints_in_progress.push(api_endpoint);