increase recachetime
This commit is contained in:
parent
9c1e25748d
commit
82ab711f45
|
@ -20,7 +20,7 @@ export class irc {
|
||||||
this.username = this.options.username || "test";
|
this.username = this.options.username || "test";
|
||||||
this.realname = this.options.realname || "test";
|
this.realname = this.options.realname || "test";
|
||||||
this.channels = this.options.channels || [];
|
this.channels = this.options.channels || [];
|
||||||
this._recachetime = 60 * 5; // 5 minutes
|
this._recachetime = 60 * 30; // 30 minutes
|
||||||
this._cmd = new Map();
|
this._cmd = new Map();
|
||||||
|
|
||||||
fs.readdirSync(`${__dirname}/irc/`).forEach(file => {
|
fs.readdirSync(`${__dirname}/irc/`).forEach(file => {
|
||||||
|
@ -99,9 +99,30 @@ export class irc {
|
||||||
}
|
}
|
||||||
whois(user, force = false) {
|
whois(user, force = false) {
|
||||||
user = user.toLowerCase();
|
user = user.toLowerCase();
|
||||||
if(this.server.user.hasi(user) && !force)
|
let tmpuser = {};
|
||||||
if(this.server.user.geti(user).cached >= ~~(Date.now() / 1000) - this._recachetime)
|
if(this.server.user.hasi(user) && !force) {
|
||||||
|
console.log("existiert", user);
|
||||||
|
tmpuser = this.server.user.geti(user);
|
||||||
|
if(tmpuser.cached >= ~~(Date.now() / 1000) - this._recachetime) {
|
||||||
|
console.log("already cached", user);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpuser = {
|
||||||
|
nickname: tmpuser.nickname || false,
|
||||||
|
username: tmpuser.username || false,
|
||||||
|
hostname: tmpuser.hostname || false,
|
||||||
|
realname: tmpuser.realname || false,
|
||||||
|
account: tmpuser.account || false,
|
||||||
|
registered: tmpuser.registered || false,
|
||||||
|
oper: tmpuser.oper || false,
|
||||||
|
channels: tmpuser.channels || [],
|
||||||
|
cached: ~~(Date.now() / 1000)
|
||||||
|
};
|
||||||
|
this.server.user.set(user, tmpuser);
|
||||||
|
|
||||||
|
console.log("whois", user);
|
||||||
this.send(`WHOIS ${user}`);
|
this.send(`WHOIS ${user}`);
|
||||||
}
|
}
|
||||||
parsePrefix(prefix) {
|
parsePrefix(prefix) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user