Recordtick is no longer a thread

This commit is contained in:
dave 2014-08-26 15:09:40 -07:00
parent 02a1a42edf
commit 15550b3b9b
2 changed files with 6 additions and 7 deletions

5
app.py
View File

@ -94,6 +94,11 @@ if __name__ == '__main__' or 'uwsgi' in __name__:
def __init__(self):
self.REC = recordTick(db)
@cherrypy.expose
def tick(self):
self.REC.tick()
return "OK"
@cherrypy.expose
def getStreams(self):
streamList = db.execute('SELECT * FROM "streams"')

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3
from threading import Thread
import time
import datetime
from sched import scheduler
@ -10,17 +9,12 @@ import subprocess
import os
import os.path
class recordTick(Thread):
class recordTick:
def __init__(self, database):
Thread.__init__(self)
# sqlite3 reference
self.db = database
# list of downloader threads
self.threads = {}
# tick timer
self.timer = scheduler(time.time, time.sleep)
self.start()
def run(self):
time.sleep(3)