Recordtick is no longer a thread
This commit is contained in:
parent
02a1a42edf
commit
15550b3b9b
5
app.py
5
app.py
|
@ -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"')
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue