client for test

This commit is contained in:
andrei-mihnea-cerbu
2025-02-04 20:08:56 +02:00
parent dcf505c89b
commit 885627213e
20 changed files with 158 additions and 240 deletions
+3 -4
View File
@@ -1,15 +1,14 @@
import { promises as fs, watch, FSWatcher } from 'fs'
import path from 'path'
import { JsonDatabase } from '../database/database'
import { DatabaseScheme } from '../database/schemes/database_scheme'
import { Database } from '../database/database'
export class DirectoryWatcher {
private readonly watchers: Map<string, FSWatcher> // Stores watchers with directory ID as the key
private readonly db: JsonDatabase<DatabaseScheme, any>
private readonly db: Database
private totalSizes: Map<string, number> // Stores total sizes per directory ID
constructor(pathToDatabaseFile: string) {
this.db = new JsonDatabase<DatabaseScheme, any>(pathToDatabaseFile)
this.db = new Database(pathToDatabaseFile)
this.watchers = new Map<string, FSWatcher>()
this.totalSizes = new Map<string, number>()
}