lib/fluent/plugin/geoip.rb in fluent-plugin-viki-0.1.4 vs lib/fluent/plugin/geoip.rb in fluent-plugin-viki-0.1.5
- old
+ new
@@ -18,10 +18,14 @@
record['region_name'] = city.subdivisions.first && city.subdivisions.first.iso_code
record
end
def global_geoip
- @@global_geoip ||= ::MaxMindDB.new(geoip_db_path)
+ if Time.now.strftime('%M:%S') == '01:00'
+ @@global_geoip = ::MaxMindDB.new(geoip_db_path)
+ else
+ @@global_geoip ||= ::MaxMindDB.new(geoip_db_path)
+ end
end
def geoip_db_path
'/etc/GeoIP2-City.mmdb'
end
\ No newline at end of file