oschwald/geoip2-golang

Update Procedure

chrisprobst opened this issue · 1 comments

Hi,

what are the implications of using geoipupdate using cron while having an open reference to the database? Is this problematic? How can an update be performed? We are using this library extensively for StriveCDN and would like to know how this situation can have negative impacts.

Best,
Chris

On a Linux or similar OS, there should be no problems running geiopupdate while using this library. The default mode is memory map, and it will continue to use the old file until it is closed.

If you want to switch to the new file, you will need to replace the reader with one for the new file. In a web service I wrote that uses this library, I use fsnotify to watch for a new database and then replace it as needed.