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)
|
||||
{
|
||||
throw new Error('Mantis API endpoint or key not configured in environment variables.');
|
||||
return {
|
||||
url: null,
|
||||
headers: null,
|
||||
};
|
||||
}
|
||||
const headers = {
|
||||
Authorization: `${MANTIS_API_KEY}`,
|
||||
|
@ -209,6 +212,8 @@ async function processTicketsInQueue()
|
|||
const downloadQueue = [];
|
||||
|
||||
export async function setup()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Initialize the download queue
|
||||
downloadQueue.length = 0;
|
||||
|
@ -235,3 +240,8 @@ 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