mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 10:17:32 -06:00
Address @matsjla's awesome comments
This commit is contained in:
Vendored
+2
-2
@@ -53,7 +53,7 @@ export abstract class BaseCache implements Cache {
|
||||
hits: number;
|
||||
protected countersEnabled: boolean;
|
||||
|
||||
protected constructor(cacheName, details, type) {
|
||||
protected constructor(cacheName: string, details: string, type: string) {
|
||||
this.cacheName = cacheName;
|
||||
this.details = details;
|
||||
this.type = type;
|
||||
@@ -77,7 +77,7 @@ export abstract class BaseCache implements Cache {
|
||||
logger.info(`${this.cacheName} ${this.details}: cache stats: ${this.statString()}`);
|
||||
}
|
||||
|
||||
static hash(object): string {
|
||||
static hash(object: any): string {
|
||||
return getHash(object, HashVersion);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -44,7 +44,7 @@ export class InMemoryCache extends BaseCache {
|
||||
return `${super.statString()}, LRU has ${this.cache.itemCount} item(s) totalling ${this.cache.length} bytes`;
|
||||
}
|
||||
|
||||
override async getInternal(key): Promise<GetResult> {
|
||||
override async getInternal(key: string): Promise<GetResult> {
|
||||
const cached = this.cache.get(key);
|
||||
return {hit: !!cached, data: cached};
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -54,7 +54,7 @@ export class S3Cache extends BaseCache {
|
||||
});
|
||||
}
|
||||
|
||||
override async getInternal(key): Promise<GetResult> {
|
||||
override async getInternal(key: string): Promise<GetResult> {
|
||||
try {
|
||||
return await this.s3.get(key, this.path);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user