Wrap downloader in a catch
This commit is contained in:
parent
c1cff132b3
commit
ef002ec79b
1 changed files with 29 additions and 19 deletions
|
@ -16,7 +16,10 @@ export async function getMantisSettings()
|
||||||
|
|
||||||
if (!MANTIS_API_ENDPOINT || !MANTIS_API_KEY)
|
if (!MANTIS_API_ENDPOINT || !MANTIS_API_KEY)
|
||||||
{
|
{
|
||||||
throw new Error('Mantis API endpoint or key not configured in environment variables.');
|
return {
|
||||||
|
url: null,
|
||||||
|
headers: null,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
const headers = {
|
const headers = {
|
||||||
Authorization: `${MANTIS_API_KEY}`,
|
Authorization: `${MANTIS_API_KEY}`,
|
||||||
|
@ -210,6 +213,8 @@ const downloadQueue = [];
|
||||||
|
|
||||||
export async function setup()
|
export async function setup()
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
// Initialize the download queue
|
// Initialize the download queue
|
||||||
downloadQueue.length = 0;
|
downloadQueue.length = 0;
|
||||||
|
|
||||||
|
@ -234,4 +239,9 @@ export async function setup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(error)
|
||||||
|
{
|
||||||
|
logger.error('Error setting up Mantis downloader:', error);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue