forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new FrozenCacheAdapter for schema cache
- Loading branch information
Logan Buckley
committed
Sep 21, 2020
1 parent
56fb66d
commit c02ee69
Showing
5 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export class FrozenCacheAdapter { | ||
constructor() { | ||
this.cache = {}; | ||
} | ||
|
||
get(key) { | ||
const record = this.cache[key]; | ||
if (!record) { | ||
return Promise.resolve(null); | ||
} | ||
return Promise.resolve(record); | ||
} | ||
|
||
// eslint-disable-next-line no-unused-vars | ||
put(key, value, ttl) { | ||
this.cache[key] = value; | ||
return Promise.resolve(); | ||
} | ||
|
||
del(key) { | ||
delete this.cache[key]; | ||
return Promise.resolve(); | ||
} | ||
|
||
clear() { | ||
return Promise.resolve(); | ||
} | ||
} | ||
|
||
export default FrozenCacheAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters