Skip to content

Commit 4758d2c

Browse files
committed
chore: lint
1 parent 24cf680 commit 4758d2c

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

api/src/unraid-api/graph/resolvers/logs/logs.service.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ interface LogFileContent {
2626
@Injectable()
2727
export class LogsService {
2828
private readonly logger = new Logger(LogsService.name);
29-
private readonly logWatchers = new Map<string, { watcher: chokidar.FSWatcher; position: number; subscriptionCount: number }>();
29+
private readonly logWatchers = new Map<
30+
string,
31+
{ watcher: chokidar.FSWatcher; position: number; subscriptionCount: number }
32+
>();
3033
private readonly DEFAULT_LINES = 100;
3134

3235
/**
@@ -122,7 +125,9 @@ export class LogsService {
122125
const watcher = this.logWatchers.get(normalizedPath);
123126
if (watcher) {
124127
watcher.subscriptionCount++;
125-
this.logger.debug(`Incremented subscription count for ${normalizedPath} to ${watcher.subscriptionCount}`);
128+
this.logger.debug(
129+
`Incremented subscription count for ${normalizedPath} to ${watcher.subscriptionCount}`
130+
);
126131
}
127132
}
128133

@@ -205,7 +210,9 @@ export class LogsService {
205210
// Store the watcher and current position with initial subscription count of 1
206211
this.logWatchers.set(path, { watcher, position, subscriptionCount: 1 });
207212

208-
this.logger.debug(`Started watching log file with chokidar: ${path} (subscription count: 1)`);
213+
this.logger.debug(
214+
`Started watching log file with chokidar: ${path} (subscription count: 1)`
215+
);
209216
} catch (error: unknown) {
210217
this.logger.error(`Error setting up chokidar file watcher for ${path}: ${error}`);
211218
}
@@ -218,12 +225,14 @@ export class LogsService {
218225
public stopWatchingLogFile(path: string): void {
219226
const normalizedPath = join(this.logBasePath, basename(path));
220227
const watcher = this.logWatchers.get(normalizedPath);
221-
228+
222229
if (watcher) {
223230
// Decrement subscription count
224231
watcher.subscriptionCount--;
225-
this.logger.debug(`Decremented subscription count for ${normalizedPath} to ${watcher.subscriptionCount}`);
226-
232+
this.logger.debug(
233+
`Decremented subscription count for ${normalizedPath} to ${watcher.subscriptionCount}`
234+
);
235+
227236
// Only close the watcher when subscription count reaches 0
228237
if (watcher.subscriptionCount <= 0) {
229238
watcher.watcher.close();

0 commit comments

Comments
 (0)