jpillora / ipfilter

A package for IP Filtering in Go (golang)
MIT License
387 stars 47 forks source link

Check for zero-byte file before attempting to load DB #1

Closed Ruxton closed 7 years ago

Ruxton commented 7 years ago

A situation arose on boot where the service acquired a 0-byte file from the download as there was no remote access at the specific moment it started.

This allows it to attempt to re-download next start if the file is 0bytes and IPDBNoFetch is false.

Prior to this minor fix it would EOF error on os.Open

jpillora commented 7 years ago

That's strange, at some point, I'll try to prevent it from creating the file in the first place, though for now this will work :) Thanks!