Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit eb747a0

Browse files
committed
refactor: store maxmind databases cache in config subdir #937
1 parent 6a2cc61 commit eb747a0

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

src/classes/netstat.class.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ class Netstat {
4747
};
4848
let geolite2 = require("geolite2-redist");
4949
let maxmind = require("maxmind");
50-
geolite2.open('GeoLite2-City', path => {
51-
return maxmind.open(path);
52-
}).catch(e => {throw e}).then(lookup => {
53-
this.geoLookup = lookup;
54-
this.lastconn.finished = true;
55-
});
50+
geolite2.downloadDbs(require("path").join(require("electron").remote.app.getPath("userData"), "geoIPcache")).then(() => {
51+
geolite2.open('GeoLite2-City', path => {
52+
return maxmind.open(path);
53+
}).catch(e => {throw e}).then(lookup => {
54+
this.geoLookup = lookup;
55+
this.lastconn.finished = true;
56+
});
57+
})
5658
}
5759
updateInfo() {
5860
window.si.networkInterfaces().then(async data => {

src/package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dependencies": {
2626
"augmented-ui": "^1.1.2",
2727
"color": "3.1.3",
28-
"geolite2-redist": "^1.0.7",
28+
"geolite2-redist": "^2.0.0",
2929
"howler": "2.2.1",
3030
"maxmind": "4.3.1",
3131
"nanoid": "3.1.18",

0 commit comments

Comments
 (0)