Making file check more efficent.
This commit is contained in:
6
index.js
6
index.js
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user