GitSquared / node-geolite2-redist

Redistribution of MaxMind GeoLite2 GeoIP databases as an npm library
https://gitsquared.github.io/node-geolite2-redist/
Other
72 stars 15 forks source link

Disable automatic updates #33

Closed jlarmstrongiv closed 5 months ago

jlarmstrongiv commented 5 months ago

Due to license requirements, this package automatically updates the databases in the background when it detects that a new version is available. This should be transparent for most usecases, if you're experiencing any problem with it, please file an issue.

I’m using a read-only file system, so I need to be able to disable (or gracefully catch and ignore) automatic updates.

I already implemented my own automatic updates that runs on a daily schedule. I run geolite.downloadDbs() and package the databases myself in the build and bundling process.

Is there an option to disable automatic updates? Maybe some big and scary option like __FOR_LEGAL_REASONS_DO_NOT_DISABLE_DB_UPDATES_UNLESS_YOU_MANUALLY_UPDATE_THE_DB_YOURSELF__. Or, just graceful failure where it won’t crash the program (and an option to disable any warning/error messages).

Anyway, I know it’s an edge case, but I’m wondering what you think the best solution is

GitSquared commented 5 months ago

@jlarmstrongiv update attempts on a read-only filesystem should fail gracefully, I believe. If you're encountering crashes or errors, please let me know and I'll make a fix!