Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05a9ca1

Browse files
committed
refactor(cache): Update file cache name and gitignore
1 parent e2c8158 commit 05a9ca1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ dist
120120
config/*.json
121121
config/mscache
122122
config/yti-*
123+
config/*.cache
123124
*.txt
124125
.idea/
125126

src/backend/common/Cache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class MSCache {
9090
ttl: 0,
9191
lruSize: 500,
9292
cacheDir: config.connection,
93-
cacheId: 'mscache',
93+
cacheId: 'scrobble.cache',
9494
persistInterval: 1 * 1000 * 60,
9595
expirationInterval: 1 * 1000 * 60, // 1 minute
9696
});
@@ -103,7 +103,7 @@ export class MSCache {
103103
flatCache.on('error', onlySaveError);
104104
try {
105105
logger.debug('Loading cache from file...');
106-
flatCache.load('mscache');
106+
flatCache.load('scrobble.cache');
107107
if(loadError !== undefined) {
108108
throw loadError;
109109
}
@@ -116,7 +116,7 @@ export class MSCache {
116116
logger.debug('Saved cache to file');
117117
});
118118
} catch (e) {
119-
logger.warn(new Error(`Unable to use file cache at ${path.join(config.connection, 'mscache')}`, {cause: e}));
119+
logger.warn(new Error(`Unable to use file cache at ${path.join(config.connection, 'scrobble.cache')}`, {cause: e}));
120120
}
121121
secondaryCache = new Keyv({store: flatCache, throwOnErrors: true});
122122
}

src/backend/scrobblers/AbstractScrobbleClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export default abstract class AbstractScrobbleClient extends AbstractComponent i
312312
const cachedDLength = cachedDead.length;
313313
this.deadLetterScrobbles = cachedDead;
314314

315-
return `Scrobbled from Cache: ${cachedQLength} Queue | ${cachedDLength} Dead Letter`;
315+
return `Scrobbles from Cache: ${cachedQLength} Queue | ${cachedDLength} Dead Letter`;
316316
}
317317

318318
protected async postInitialize(): Promise<void> {

0 commit comments

Comments
 (0)