Skip to content

Commit

Permalink
fix: update resource on add
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Jul 12, 2023
1 parent 52a8441 commit d04d54a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CLI = {

await Cli.parse( CLI );

await externalResources.add( "softvisio-node/geoip-asn/resources/geolite2-asn", import.meta.url, { "update": false } );
externalResources.add( "softvisio-node/geoip-asn/resources/geolite2-asn", import.meta.url );

const res = await externalResources.update( {
"remote": true,
Expand Down
6 changes: 4 additions & 2 deletions lib/geoip-asn.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ const cache = new CacheLru( { "maxSize": 1000 } );

var mmdb;

const resource = await externalResources.add( "softvisio-node/geoip-asn/resources/geolite2-asn", import.meta.url );
resource.on( "update", () => ( mmdb = null ) );
const resource = await externalResources
.add( "softvisio-node/geoip-asn/resources/geolite2-asn", import.meta.url )
.on( "update", () => ( mmdb = null ) )
.check();

class GeoipAsn {
constructor () {}
Expand Down

0 comments on commit d04d54a

Please sign in to comment.