From 3dd3a2c732422836009bc03648bece7d11e9f633 Mon Sep 17 00:00:00 2001 From: samwiseg0 Date: Thu, 27 Dec 2018 11:24:45 -0500 Subject: [PATCH] Fix first run exception --- varken/helpers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/varken/helpers.py b/varken/helpers.py index 0a5d166..492cebf 100644 --- a/varken/helpers.py +++ b/varken/helpers.py @@ -39,6 +39,8 @@ class GeoIPHandler(object): except FileNotFoundError: self.logger.error("Could not find GeoLite2 DB as: %s", self.dbfile) self.download() + dbdate = date.fromtimestamp(stat(self.dbfile).st_ctime) + first_wednesday_day = [week[2:3][0] for week in monthcalendar(today.year, today.month) if week[2:3][0] != 0][0] first_wednesday_date = date(today.year, today.month, first_wednesday_day)