- // FIXME: Disabled until the spurious configuration file change detection is identified
- // idTagsFileWatcher: watchJsonFile(
- // file,
- // FileType.Authorization,
- // this.logPrefix(file),
- // undefined,
- // (event, filename) => {
- // if (isNotEmptyString(filename) && event === 'change') {
- // try {
- // logger.debug(
- // `${this.logPrefix(file)} ${FileType.Authorization} file have changed, reload`,
- // );
- // this.deleteIdTagsCache(file);
- // this.deleteIdTagsCacheIndexes(file);
- // } catch (error) {
- // handleFileException(
- // file,
- // FileType.Authorization,
- // error as NodeJS.ErrnoException,
- // this.logPrefix(file),
- // {
- // throwError: false,
- // },
- // );
- // }
- // }
- // },
- // ),
- });
- }
-
- private getIdTagsCache(file: string): string[] | undefined {
- return this.idTagsCaches.get(file)?.idTags;
- }
-
- private deleteIdTagsCache(file: string): boolean {
- this.idTagsCaches.get(file)?.idTagsFileWatcher?.close();
- return this.idTagsCaches.delete(file);
- }
-
- private deleteIdTagsCacheIndexes(file: string): boolean {
- const deleted: boolean[] = [];
+ idTagsFileWatcher: watchJsonFile(
+ file,
+ FileType.Authorization,
+ this.logPrefix(file),
+ undefined,
+ (event, filename) => {
+ if (isNotEmptyString(filename) && event === 'change') {
+ try {
+ logger.debug(
+ `${this.logPrefix(file)} ${FileType.Authorization} file have changed, reload`
+ )
+ this.deleteIdTags(file)
+ } catch (error) {
+ handleFileException(
+ file,
+ FileType.Authorization,
+ error as NodeJS.ErrnoException,
+ this.logPrefix(file),
+ {
+ throwError: false
+ }
+ )
+ }
+ }
+ }
+ )
+ })
+ }
+
+ private getIdTagsCache (file: string): string[] | undefined {
+ return this.idTagsCaches.get(file)?.idTags
+ }
+
+ private deleteIdTagsCache (file: string): boolean {
+ this.idTagsCaches.get(file)?.idTagsFileWatcher?.close()
+ return this.idTagsCaches.delete(file)
+ }
+
+ private deleteIdTagsCacheIndexes (file: string): boolean {
+ const deleted: boolean[] = []