From 47ccd0f7bedcc70aeca188612cf359a39467cde0 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 6 Oct 2015 00:13:10 +0100 Subject: [PATCH] Corrected refresh rate limiting for utc. --- wanikaniburned.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wanikaniburned.py b/wanikaniburned.py index 13ebb10..ba6ad7d 100644 --- a/wanikaniburned.py +++ b/wanikaniburned.py @@ -93,12 +93,11 @@ class User(db.Model): self.vocabulary = json.dumps(items) def update_all(self): - if (datetime.now() - self.last_updated) > timedelta(hours=1): + if (datetime.utcnow() - self.last_updated) > timedelta(hours=1): self.parse_radicals_and_userdata() self.parse_kanji() self.parse_vocabulary() self.last_updated = datetime.utcnow() - db.session.add(self) db.session.commit() else: raise ValueError('Cannot refresh now, try again later.')