Fix: Delete old favicons, save us tons of bandwidth
This commit is contained in:
parent
4c3535a9d0
commit
7ac62da3c9
26
app.js
26
app.js
@ -26,14 +26,20 @@ function pingAll() {
|
|||||||
res.favicon = config.faviconOverride[network.name];
|
res.favicon = config.faviconOverride[network.name];
|
||||||
}
|
}
|
||||||
|
|
||||||
server.io.sockets.emit('update', {
|
var networkSnapshot = {
|
||||||
result: res,
|
info: {
|
||||||
error: err,
|
name: network.name,
|
||||||
info: {
|
timestamp: util.getCurrentTimeMs()
|
||||||
name: network.name,
|
}
|
||||||
timestamp: util.getCurrentTimeMs()
|
};
|
||||||
}
|
|
||||||
});
|
if (networkSnapshot) {
|
||||||
|
object.result = res;
|
||||||
|
} else if (err) {
|
||||||
|
networkSnapshot.err = error;
|
||||||
|
}
|
||||||
|
|
||||||
|
server.io.sockets.emit('update', networkSnapshot);
|
||||||
|
|
||||||
// Log our response.
|
// Log our response.
|
||||||
if (!networkHistory[network.ip]) {
|
if (!networkHistory[network.ip]) {
|
||||||
@ -45,6 +51,10 @@ function pingAll() {
|
|||||||
// Remove our previous data that we don't need anymore.
|
// Remove our previous data that we don't need anymore.
|
||||||
for (var i = 0; i < _networkHistory.length; i++) {
|
for (var i = 0; i < _networkHistory.length; i++) {
|
||||||
delete _networkHistory[i].info;
|
delete _networkHistory[i].info;
|
||||||
|
|
||||||
|
if (_networkHistory[i].result) {
|
||||||
|
delete _networkHistory[i].result.favicon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_networkHistory.push({
|
_networkHistory.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user