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:
@@ -18,7 +18,6 @@ import {
|
||||
InboxDocument,
|
||||
type InboxSource,
|
||||
} from '../database/entities/inbox-document.entity';
|
||||
import { getErrorCode, getErrorMessage } from '../common/error.util';
|
||||
|
||||
const STABILITY_MS = 5000;
|
||||
|
||||
@@ -64,7 +63,7 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
this.logger.log(`Starte Überwachung: ${this.sourceRoot}`);
|
||||
|
||||
this.watcher = chokidar.watch(this.sourceRoot, {
|
||||
ignored: /(^|[/\\])\../,
|
||||
ignored: /(^|[\/\\])\../,
|
||||
persistent: true,
|
||||
ignoreInitial: true,
|
||||
awaitWriteFinish: {
|
||||
@@ -75,9 +74,9 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
});
|
||||
|
||||
this.watcher
|
||||
.on('add', (filePath: string) => void this.handleNewFile(filePath))
|
||||
.on('add', (filePath: string) => this.handleNewFile(filePath))
|
||||
.on('error', (error: Error) =>
|
||||
this.logger.error(`Watcher Fehler: ${getErrorMessage(error)}`),
|
||||
this.logger.error(`Watcher Fehler: ${error.message}`),
|
||||
);
|
||||
|
||||
this.logger.log('Scanner-Watcher aktiv');
|
||||
@@ -97,10 +96,10 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
withFileTypes: true,
|
||||
});
|
||||
subdirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
if (!silent) {
|
||||
this.logger.warn(
|
||||
`Scanner-Check: Quellverzeichnis nicht lesbar (${this.sourceRoot}): ${getErrorMessage(err)}`,
|
||||
`Scanner-Check: Quellverzeichnis nicht lesbar (${this.sourceRoot}): ${err.message}`,
|
||||
);
|
||||
}
|
||||
return;
|
||||
@@ -112,10 +111,10 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
let files: string[];
|
||||
try {
|
||||
files = await fs.readdir(dir);
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
if (!silent) {
|
||||
this.logger.warn(
|
||||
`Scanner-Check: ${dir} nicht lesbar: ${getErrorMessage(err)}`,
|
||||
`Scanner-Check: ${dir} nicht lesbar: ${err.message}`,
|
||||
);
|
||||
}
|
||||
continue;
|
||||
@@ -152,8 +151,8 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
this.isPeriodicScanning = true;
|
||||
try {
|
||||
await this.initialScan(true);
|
||||
} catch (err: unknown) {
|
||||
this.logger.error(`Periodic Scan Fehler: ${getErrorMessage(err)}`);
|
||||
} catch (err: any) {
|
||||
this.logger.error(`Periodic Scan Fehler: ${err.message}`);
|
||||
} finally {
|
||||
this.isPeriodicScanning = false;
|
||||
}
|
||||
@@ -222,14 +221,14 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
try {
|
||||
await this.barcodeScanner.scanAndMatch(doc);
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.warn(
|
||||
`Barcode-Scan nach Move fehlgeschlagen (${id}): ${getErrorMessage(err)}`,
|
||||
`Barcode-Scan nach Move fehlgeschlagen (${id}): ${err.message}`,
|
||||
);
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.error(
|
||||
`Übernahme fehlgeschlagen für ${filePath}: ${getErrorMessage(err)}`,
|
||||
`Übernahme fehlgeschlagen für ${filePath}: ${err.message}`,
|
||||
);
|
||||
} finally {
|
||||
this.processing.delete(filePath);
|
||||
@@ -242,10 +241,8 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
pending = await this.documentRepo.find({
|
||||
where: [{ PageCount: 0 }, { QrCodes: IsNull() }],
|
||||
});
|
||||
} catch (err: unknown) {
|
||||
this.logger.warn(
|
||||
`Backfill: DB-Query fehlgeschlagen: ${getErrorMessage(err)}`,
|
||||
);
|
||||
} catch (err: any) {
|
||||
this.logger.warn(`Backfill: DB-Query fehlgeschlagen: ${err.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -254,10 +251,8 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
try {
|
||||
const didScan = await this.barcodeScanner.ensureScanned(doc);
|
||||
if (didScan) scanned += 1;
|
||||
} catch (err: unknown) {
|
||||
this.logger.warn(
|
||||
`Backfill fehlgeschlagen (${doc.Id}): ${getErrorMessage(err)}`,
|
||||
);
|
||||
} catch (err: any) {
|
||||
this.logger.warn(`Backfill fehlgeschlagen (${doc.Id}): ${err.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,8 +267,8 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
try {
|
||||
await fs.rename(src, dest);
|
||||
return;
|
||||
} catch (err: unknown) {
|
||||
if (getErrorCode(err) !== 'EXDEV') throw err;
|
||||
} catch (err: any) {
|
||||
if (err.code !== 'EXDEV') throw err;
|
||||
}
|
||||
// Cross-device: copy + unlink. Wenn unlink scheitert, Kopie zurückrollen,
|
||||
// damit ein kaputter Mount nicht bei jedem Neustart Duplikate produziert.
|
||||
|
||||
Reference in New Issue
Block a user