mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
交互式安装
This commit is contained in:
1 parent
6134a16f8c
commit
27cfe81e31
21 files changed
+333
-181
No files matched your search
@@ -6,11 +6,19 @@ async function add(ip) {
|
||||
const expireAt = new Date(new Date().getTime() + 365 * 24 * 60 * 60 * 1000);
|
||||
return coll.findOneAndUpdate({ _id: ip }, { $set: { expireAt } }, { upsert: true });
|
||||
}
|
||||
|
||||
function get(ip) {
|
||||
return coll.findOne({ _id: ip });
|
||||
}
|
||||
|
||||
function del(ip) {
|
||||
return coll.deleteOne({ _id: ip });
|
||||
}
|
||||
|
||||
module.exports = { add, get, del };
|
||||
function index() {
|
||||
return coll.createIndex('expireAt', { expireAfterSeconds: 0 });
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
add, get, del, index,
|
||||
};
|
||||
Reference in new issue
Block a user