v12.0.0 - initial commit
This commit is contained in:
commit
e2c49ea43c
1145 changed files with 97211 additions and 0 deletions
18
packages/server/lib/new-admin/services/restriction-level.js
Normal file
18
packages/server/lib/new-admin/services/restriction-level.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const mem = require('mem')
|
||||
const { machines } = require('typesafe-db')
|
||||
|
||||
// Cache configuration: 30 minutes
|
||||
const CACHE_DURATION = 30 * 60 * 1000
|
||||
|
||||
const _getHighestRestrictionLevel = async () => {
|
||||
return machines.getHighestRestrictionLevel()
|
||||
}
|
||||
|
||||
const getCachedRestrictionLevel = mem(_getHighestRestrictionLevel, {
|
||||
maxAge: CACHE_DURATION,
|
||||
cacheKey: () => '',
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
getCachedRestrictionLevel,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue