mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-13 08:35:46 -04:00
renamed check_for_requests to heartbeat, and made the heartbeat serve all items in the queue instead of just the latest (#36)
This commit is contained in:
parent
68bba73a8c
commit
1cc817db3c
3 changed files with 36 additions and 26 deletions
|
@ -51,12 +51,18 @@ def copy_url():
|
|||
clipboard.set_text(url)
|
||||
return ''
|
||||
|
||||
@app.route("/check_for_requests")
|
||||
@app.route("/heartbeat")
|
||||
def check_for_requests():
|
||||
global onionshare
|
||||
try:
|
||||
r = onionshare.request_q.get(False)
|
||||
return json.dumps(r)
|
||||
except onionshare.Queue.Empty:
|
||||
return ''
|
||||
events = []
|
||||
|
||||
done = False
|
||||
while not done:
|
||||
try:
|
||||
r = onionshare.q.get(False)
|
||||
events.append(r)
|
||||
except onionshare.Queue.Empty:
|
||||
done = True
|
||||
|
||||
return json.dumps(events)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue