appmethods.py 716 Bytes
Newer Older
1 2 3 4 5 6 7
# app imports
from parscript import load_data
from getconnectedscript import load_getconn_data
import redisactions as f

# python imports
import json
8
import datetime
9

10 11
# other imports
import redis
12

13 14

# attempts to update both dbs and logs the result
15 16 17
def updatebothdbs():
    livesuccess = f.livedbfill(json.dumps(load_data(), ensure_ascii=False))
    gcsuccess = f.gcdbfill(json.dumps(load_getconn_data(), ensure_ascii=False))
18 19 20 21 22 23 24 25
    successLog = str(datetime.datetime.now()) \
        + "\n\nAttempted to update cache." \
        + "\n25Live: " + str(livesuccess) \
        + "\nGC: " + str(gcsuccess)

    f.appendtoupdatelog(successLog)

    return successLog
26 27 28 29


def testprint():
    print "Schedule action completed!"