Skip to content

Commit

Permalink
Merge pull request #876 from hv7214/issue806
Browse files Browse the repository at this point in the history
[FIX] Download on clicking start button
  • Loading branch information
JaDogg authored May 16, 2020
2 parents 4996282 + 300655b commit fed980d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions components/core/DownloadDaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def __init__(self, ws):
queue.Queue.__init__(self)
self.ws = ws
self.num_workers = 5
self.start_workers()

def add_to_queue(self, download):
self.put(download)
Expand Down Expand Up @@ -67,7 +66,7 @@ def worker(self):

class MessageHandler():

def __init__(self,ws):
def __init__(self, ws):
self.num_workers = 5
self.ws = ws

Expand Down Expand Up @@ -138,7 +137,7 @@ def worker(self):
get_status(self.ws, None, data['params'][0]['gid'])
db_lock.release()
messageQueue.task_done()

class RepeatedTimer(object):
def __init__(self, interval, function, *args, **kwargs):
self._timer = None
Expand Down Expand Up @@ -244,8 +243,7 @@ def on_error(ws, error):


def on_close(ws):
pass

logging.info("Socket closed")

def on_open(ws):
initialize(ws)
Expand All @@ -264,9 +262,10 @@ def starter(socket):
on_close=on_close)
ws.on_open = on_open
handler = Handler(ws)
handlerLst.append(handler)
# socketio.emit("test", {'data': 'A NEW FILE WAS POSTED'}, namespace='/news')
threading.Thread(target=handler.start_workers).start()
mHandler = MessageHandler(ws)
mHandler = MessageHandler(ws)
threading.Thread(target=mHandler.start_message_workers).start()
messageQueue.join()
ws.run_forever()
Expand Down
1 change: 1 addition & 0 deletions components/core/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def serve_ui1():
return send_file(os.path.dirname(os.path.realpath(__file__)) + "/ui/index.html")



def register_blueprint(server):
"""Register Flask blueprints."""
server.register_blueprint(User_endpoints.userprint, url_prefix="/api")
Expand Down

0 comments on commit fed980d

Please sign in to comment.