add auto invalidation of dns cache
This commit is contained in:
@ -179,6 +179,15 @@ export default class Server {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates the DNS cache for the server.
|
||||
*/
|
||||
public invalidateDns() {
|
||||
this.dnsInfo = {
|
||||
hasResolved: false,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the server.
|
||||
*
|
||||
|
@ -23,6 +23,13 @@ export default class ServerManager {
|
||||
cron.schedule(Config.pinger.pingCron, () => {
|
||||
this.pingServers();
|
||||
});
|
||||
|
||||
cron.schedule(Config.pinger.dnsInvalidationCron, () => {
|
||||
logger.info("Invalidating DNS cache for all servers");
|
||||
for (const server of this.servers) {
|
||||
server.invalidateDns();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user