Browse Source

fixed db refresh

master
trav 6 months ago
parent
commit
20205da9a5
  1. 2
      carousel.py
  2. 9
      refreshdb.py
  3. BIN
      refreshdb.pyc

2
carousel.py

@ -31,7 +31,7 @@ intervalTime = 1800
syncTime = 3600
#keep track of where we are moving through intervalTime, syncTime and where we are in the db, and what flier we're currently displaying
timeIndex = 1200
syncIndex = 3550
syncIndex = 0
dbIndex = 1
flierPath = "noneyet"
button_flag = "null"

9
refreshdb.py

@ -34,7 +34,7 @@ def fresh():
#get time of last db-to-ssb sync from db
root_entry = db.get(doc_id=1)
last_run = root_entry["date"]
print 'looking for posts since: ' last_run
print 'looking for posts since: ', last_run
#if last run is never ran then only look back 1 month (new installs don't need EVERY old post...)
if last_run==4:
@ -77,7 +77,7 @@ def fresh():
#so now theblob[0] should be THE blob
dablob = theblob[0]
print dablob
print dablob, 'at', timestamp
#check to make sure we haven't already added this one
Fruit = Query()
@ -93,7 +93,7 @@ def fresh():
exit()
#tru/false whether we have the blob:
newssb=proc.stdout.read()
print 'do we have the blob? ' newssb
print 'do we have the blob? ', newssb
# if we have it, add it!
if (str(newssb)=='true\n'):
@ -116,7 +116,8 @@ def fresh():
#update last_run (so that we don't have to search through ALL ssb posts everytime, this keeps track of oldest
Fruit = Query()
db.update({'date': timestamp}, Fruit.ssb == 'default')
if timestamp>last_run:
db.update({'date': timestamp}, Fruit.ssb == 'default')

BIN
refreshdb.pyc

Binary file not shown.
Loading…
Cancel
Save