Revert "fix: resolve all ESLint errors in backend and frontend"
Build and Push Multi-Platform Images / build-and-push (push) Successful in 19s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 19s
This reverts commit 07dfd7e840.
This commit is contained in:
@@ -19,7 +19,6 @@ import { Email } from '../database/entities/email.entity';
|
||||
import { Attachment } from '../database/entities/attachment.entity';
|
||||
import { Content } from '../database/entities/content.entity';
|
||||
import { isERechnung } from './zugferd.util';
|
||||
import { getErrorMessage, getErrorStack } from '../common/error.util';
|
||||
|
||||
@Injectable()
|
||||
export class EmailDownloadService {
|
||||
@@ -46,10 +45,10 @@ export class EmailDownloadService {
|
||||
this.running = true;
|
||||
try {
|
||||
await this.fetchAndStore();
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.error(
|
||||
`Fehler im E-Mail-Download-Job: ${getErrorMessage(err)}`,
|
||||
getErrorStack(err),
|
||||
`Fehler im E-Mail-Download-Job: ${err.message}`,
|
||||
err.stack,
|
||||
);
|
||||
} finally {
|
||||
this.running = false;
|
||||
@@ -117,10 +116,10 @@ export class EmailDownloadService {
|
||||
}
|
||||
|
||||
await this.processMessage(msg);
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.error(
|
||||
`Fehler beim Abrufen der Nachricht ${messageId}: ${getErrorMessage(err)}`,
|
||||
getErrorStack(err),
|
||||
`Fehler beim Abrufen der Nachricht ${messageId}: ${err.message}`,
|
||||
err.stack,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -158,7 +157,7 @@ export class EmailDownloadService {
|
||||
}> = [];
|
||||
|
||||
for (const att of parsed.attachments) {
|
||||
const entry = this.buildAttachment(att);
|
||||
const entry = await this.buildAttachment(att);
|
||||
if (entry) attachmentsToPersist.push(entry);
|
||||
}
|
||||
|
||||
@@ -215,9 +214,9 @@ export class EmailDownloadService {
|
||||
|
||||
await this.pdfService.cleanup(images);
|
||||
await fs.unlink(tempPdfPath).catch(() => {});
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.warn(
|
||||
`Konnte Vorschaubilder für Anhang ${attachment.Id} nicht generieren: ${getErrorMessage(err)}`,
|
||||
`Konnte Vorschaubilder für Anhang ${attachment.Id} nicht generieren: ${err.message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -263,9 +262,9 @@ export class EmailDownloadService {
|
||||
return { processed, failed };
|
||||
}
|
||||
|
||||
private buildAttachment(
|
||||
private async buildAttachment(
|
||||
att: MailAttachment,
|
||||
): { attachment: Attachment; buffer: Buffer } | null {
|
||||
): Promise<{ attachment: Attachment; buffer: Buffer } | null> {
|
||||
const buffer = att.content;
|
||||
if (!Buffer.isBuffer(buffer) || buffer.length === 0) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user