chore: apply ESLint auto-fix across entire backend
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
Reformats code style (line breaks, indentation, type annotations) without changing logic. Also includes minor feature additions bundled in the same lint run (stats service, user-settings groups, agrarmonitor polling improvements). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { Injectable, Logger, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
|
||||
import {
|
||||
Injectable,
|
||||
Logger,
|
||||
OnModuleInit,
|
||||
OnModuleDestroy,
|
||||
} from '@nestjs/common';
|
||||
import { Cron } from '@nestjs/schedule';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
@@ -31,7 +36,10 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
@InjectRepository(InboxDocument)
|
||||
private readonly documentRepo: Repository<InboxDocument>,
|
||||
) {
|
||||
this.sourceRoot = this.configService.get<string>('SCANNER_WATCH_DIR', '/mnt/scans');
|
||||
this.sourceRoot = this.configService.get<string>(
|
||||
'SCANNER_WATCH_DIR',
|
||||
'/mnt/scans',
|
||||
);
|
||||
}
|
||||
|
||||
onModuleInit(): void {
|
||||
@@ -67,7 +75,9 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
this.watcher
|
||||
.on('add', (filePath: string) => this.handleNewFile(filePath))
|
||||
.on('error', (error: Error) => this.logger.error(`Watcher Fehler: ${error.message}`));
|
||||
.on('error', (error: Error) =>
|
||||
this.logger.error(`Watcher Fehler: ${error.message}`),
|
||||
);
|
||||
|
||||
this.logger.log('Scanner-Watcher aktiv');
|
||||
}
|
||||
@@ -82,11 +92,15 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
private async initialScan(silent = false): Promise<void> {
|
||||
let subdirs: string[];
|
||||
try {
|
||||
const entries = await fs.readdir(this.sourceRoot, { withFileTypes: true });
|
||||
const entries = await fs.readdir(this.sourceRoot, {
|
||||
withFileTypes: true,
|
||||
});
|
||||
subdirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
||||
} catch (err: any) {
|
||||
if (!silent) {
|
||||
this.logger.warn(`Scanner-Check: Quellverzeichnis nicht lesbar (${this.sourceRoot}): ${err.message}`);
|
||||
this.logger.warn(
|
||||
`Scanner-Check: Quellverzeichnis nicht lesbar (${this.sourceRoot}): ${err.message}`,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -99,7 +113,9 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
files = await fs.readdir(dir);
|
||||
} catch (err: any) {
|
||||
if (!silent) {
|
||||
this.logger.warn(`Scanner-Check: ${dir} nicht lesbar: ${err.message}`);
|
||||
this.logger.warn(
|
||||
`Scanner-Check: ${dir} nicht lesbar: ${err.message}`,
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -110,7 +126,9 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
if (!(await this.isStable(full))) {
|
||||
if (!silent) {
|
||||
this.logger.debug(`Scanner-Check: ${full} noch nicht stabil – Watcher übernimmt`);
|
||||
this.logger.debug(
|
||||
`Scanner-Check: ${full} noch nicht stabil – Watcher übernimmt`,
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -204,10 +222,14 @@ export class ScannerWatcherService implements OnModuleInit, OnModuleDestroy {
|
||||
try {
|
||||
await this.barcodeScanner.scanAndMatch(doc);
|
||||
} catch (err: any) {
|
||||
this.logger.warn(`Barcode-Scan nach Move fehlgeschlagen (${id}): ${err.message}`);
|
||||
this.logger.warn(
|
||||
`Barcode-Scan nach Move fehlgeschlagen (${id}): ${err.message}`,
|
||||
);
|
||||
}
|
||||
} catch (err: any) {
|
||||
this.logger.error(`Übernahme fehlgeschlagen für ${filePath}: ${err.message}`);
|
||||
this.logger.error(
|
||||
`Übernahme fehlgeschlagen für ${filePath}: ${err.message}`,
|
||||
);
|
||||
} finally {
|
||||
this.processing.delete(filePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user