mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-21 03:12:10 +08:00
24 lines
523 B
JavaScript
24 lines
523 B
JavaScript
const baseManagerModel = require('../model/baseManagerModel');
|
|
|
|
|
|
let onlyTokenManager = new baseManagerModel.ModelManager();
|
|
|
|
|
|
module.exports.addToken = (key, value) => {
|
|
if (onlyTokenManager.len >= 20) {
|
|
//TOken 请求最大等待队列长度,超过则统一删除
|
|
onlyTokenManager.clear();
|
|
}
|
|
onlyTokenManager.add(key, value);
|
|
}
|
|
|
|
|
|
module.exports.delToken = (key, value) => {
|
|
onlyTokenManager.del(key, value);
|
|
}
|
|
|
|
|
|
|
|
module.exports.getToken = (key) => {
|
|
return onlyTokenManager.get(key);
|
|
} |