Skip to content

Commit

Permalink
update node client to support ufc update
Browse files Browse the repository at this point in the history
  • Loading branch information
vpai committed Apr 16, 2024
1 parent 3841c45 commit 3a98ce6
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 204 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ test-data:
rm -rf $(testDataDir)
mkdir -p $(tempDir)
git clone -b ${branchName} --depth 1 --single-branch ${githubRepoLink} ${gitDataDir}
cp ${gitDataDir}rac-experiments-v3.json ${testDataDir}
cp -r ${gitDataDir}assignment-v2 ${testDataDir}
cp -r ${gitDataDir}ufc ${testDataDir}
rm -rf ${tempDir}

## test
Expand Down
9 changes: 9 additions & 0 deletions src/configuration-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@ export class InMemoryConfigurationStore implements IConfigurationStore {
this.cache = new LRUCache({ max: maxEntries });
}

isInitialized(): boolean {
return !!this.cache;
}

get<T>(key: string): T {
return this.cache.get(key) ?? null;
}

getKeys(): string[] {
// Splay because keys() returns a generator.
return [...this.cache.keys()];
}

setEntries<T>(entries: Record<string, T>) {
Object.entries(entries).forEach(([key, val]) => {
this.cache.set(key, val);
Expand Down
Loading

0 comments on commit 3a98ce6

Please sign in to comment.