Commit aa69f03b authored by Landon DeCoito's avatar Landon DeCoito

reordered redisactions imports and fixed whitespace

parent d836bd59
# app imports
from __init__ import redisdb
# python imports # python imports
import datetime import datetime
# third party imports # other imports
import redis import redis
from __init__ import redisdb
# I'm thinking we store a couple things # I'm thinking we store a couple things
# first: a key-value where the value is the dictlist # first: a key-value where the value is the dictlist
...@@ -16,6 +18,7 @@ from __init__ import redisdb ...@@ -16,6 +18,7 @@ from __init__ import redisdb
# function. and every time we find an error we want to run a dberrorfill() # function. and every time we find an error we want to run a dberrorfill()
# function. # function.
# this will update the live dictlist and the cachedate # this will update the live dictlist and the cachedate
# returns true if the dictlist is not empty, false otherwise # returns true if the dictlist is not empty, false otherwise
def gcdbfill(dictlist): def gcdbfill(dictlist):
...@@ -27,6 +30,7 @@ def gcdbfill(dictlist): ...@@ -27,6 +30,7 @@ def gcdbfill(dictlist):
return redisdb.get("gcdict") is not None return redisdb.get("gcdict") is not None
# saves new dictlist in place of previous 25Live dictlist # saves new dictlist in place of previous 25Live dictlist
# returns true if the dictlist is not empty, false otherwise # returns true if the dictlist is not empty, false otherwise
def livedbfill(dictlist): def livedbfill(dictlist):
...@@ -35,9 +39,10 @@ def livedbfill(dictlist): ...@@ -35,9 +39,10 @@ def livedbfill(dictlist):
setlastcachedate("livecachedate", str(datetime.datetime.now())) setlastcachedate("livecachedate", str(datetime.datetime.now()))
except e: except e:
return False return False
return redisdb.get("livedict") is not None return redisdb.get("livedict") is not None
# saves the last time the cache was updated # saves the last time the cache was updated
# return true if the cachedate is not empty, false otherwise # return true if the cachedate is not empty, false otherwise
def setlastcachedate(cache, date): def setlastcachedate(cache, date):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment