fix(build): modernize project tooling and package metadata
This commit is contained in:
@@ -110,8 +110,11 @@ export class ClamAVManager extends EventEmitter {
|
||||
}
|
||||
} catch (error) {
|
||||
// Check if the error is due to freshclam already running
|
||||
if (error.stderr?.includes('ERROR: Problem with internal logger') ||
|
||||
error.stdout?.includes('Resource temporarily unavailable')) {
|
||||
const execError = error as { stderr?: string; stdout?: string };
|
||||
if (
|
||||
execError.stderr?.includes('ERROR: Problem with internal logger') ||
|
||||
execError.stdout?.includes('Resource temporarily unavailable')
|
||||
) {
|
||||
console.log('Freshclam is already running, skipping manual update');
|
||||
return;
|
||||
}
|
||||
@@ -153,7 +156,7 @@ export class ClamAVManager extends EventEmitter {
|
||||
|
||||
logProcess.stdout.on('data', (data) => {
|
||||
const lines = data.toString().split('\n');
|
||||
lines.forEach(line => {
|
||||
lines.forEach((line: string) => {
|
||||
if (!line.trim()) return;
|
||||
|
||||
const event: ClamAVLogEvent = {
|
||||
@@ -255,7 +258,8 @@ export class ClamAVManager extends EventEmitter {
|
||||
// Service not ready yet, will retry
|
||||
if (checkCount >= maxChecks) {
|
||||
cleanup();
|
||||
reject(new Error(`ClamAV initialization timed out after ${maxChecks} seconds. Last error: ${error.message}`));
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
reject(new Error(`ClamAV initialization timed out after ${maxChecks} seconds. Last error: ${errorMessage}`));
|
||||
return;
|
||||
}
|
||||
checkCount++;
|
||||
|
||||
Reference in New Issue
Block a user