PoW Worker should wait for sql thread to init
- I think this was causing freezing queue on launch if not empty - I can't reproduce the bug anymore
This commit is contained in:
parent
d8301ff512
commit
511b89ebbe
|
@ -51,6 +51,11 @@ class singleWorker(threading.Thread, StoppableThread):
|
||||||
super(singleWorker, self).stopThread()
|
super(singleWorker, self).stopThread()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
while not state.sqlReady and state.shutdown == 0:
|
||||||
|
self.stop.wait(2)
|
||||||
|
if state.shutdown > 0:
|
||||||
|
return
|
||||||
|
|
||||||
# Initialize the neededPubkeys dictionary.
|
# Initialize the neededPubkeys dictionary.
|
||||||
queryreturn = sqlQuery(
|
queryreturn = sqlQuery(
|
||||||
|
|
|
@ -494,6 +494,8 @@ class sqlThread(threading.Thread):
|
||||||
parameters = (int(time.time()),)
|
parameters = (int(time.time()),)
|
||||||
self.cur.execute(item, parameters)
|
self.cur.execute(item, parameters)
|
||||||
|
|
||||||
|
state.sqlReady = True
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
item = helper_sql.sqlSubmitQueue.get()
|
item = helper_sql.sqlSubmitQueue.get()
|
||||||
if item == 'commit':
|
if item == 'commit':
|
||||||
|
|
|
@ -19,6 +19,8 @@ shutdown = 0 #Set to 1 by the doCleanShutdown function. Used to tell the proof o
|
||||||
|
|
||||||
curses = False
|
curses = False
|
||||||
|
|
||||||
|
sqlReady = False # set to true by sqlTread when ready for processing
|
||||||
|
|
||||||
# If the trustedpeer option is specified in keys.dat then this will
|
# If the trustedpeer option is specified in keys.dat then this will
|
||||||
# contain a Peer which will be connected to instead of using the
|
# contain a Peer which will be connected to instead of using the
|
||||||
# addresses advertised by other peers. The client will only connect to
|
# addresses advertised by other peers. The client will only connect to
|
||||||
|
|
Loading…
Reference in New Issue
Block a user