maxmind-reload

Get maxmind paid and lite geoip data updates with exponential and custom retry2 strategies

maxmind-reload

Get maxmind paid and lite geoip data updates with exponential and custom retry strategies

npm install maxmind-reload

maxmind-loader compatible but with tenacity

maxloader = require('maxmind-reload')
maxloader(function(errfilepath) { maxmind.init(filepath) }); // free geo data 
maxmind   = require('maxmind')
maxloader = require('maxmind-reload')
 
maxloader({
    license: undefined,  // 'maxmind license' for paid data otherwise free version used 
    retries: 5,
    pause:   5 * 1000,   // 5 seconds 
    silent:  false,      // true = don't console.log attempts 
    random:  10,         // 10%, add random amount up to 'random' percentage of pause 
    dest:    '/tmp/'     // default load free /tmp/GeoCityLite.dat 
}, function (errfilepath) {
    maxmind.init(filepath);
});

Sample factors

pause  factor  retry 2    3         4          5           6        7        8   9    10   11      12        13        14
5s     2       5s,   10s, 20s,      40s,       80s~1m,     160s=2m, 320s=4m, 8m, 16m, 32m, 64m=~1h, 128m=~2h, 256m=~4h, 512m=~8h
5s     5       5s,   25s, 125s=~2m, 625s=~10m, 3125s=~52m
 
var options = { license: 'MAXMIND_LICENSE' };
 
maxloader(options, function(errfilepath) {
    if (err) {
        console.log(err);
    } else {
        maxmind.init(filepath, { memoryCache: true });
    }
})

For additional parameter details see: maxmind-loader

Dependencies:

Development Dependencies: