mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
Do not miserably display nothing if there's less than 30 entries
This commit is contained in:
parent
470fb02022
commit
5bb6d7c890
1 changed files with 3 additions and 6 deletions
9
run.py
9
run.py
|
@ -539,7 +539,8 @@ def chunks(l, n):
|
|||
yield chunk
|
||||
chunk = []
|
||||
a = 0
|
||||
|
||||
|
||||
yield chunk
|
||||
|
||||
@app.websocket('/index-ws')
|
||||
@clean_websocket
|
||||
|
@ -581,11 +582,7 @@ async def ws_index(request, websocket):
|
|||
map(model_to_dict, Job.select().where(Job.state == "running").iterator()),
|
||||
map(model_to_dict, latest_done_jobs.iterator())), 30)
|
||||
|
||||
try:
|
||||
first_chunck = next(data)
|
||||
except StopIteration:
|
||||
# in case data is empty
|
||||
first_chunck = []
|
||||
first_chunck = next(data)
|
||||
|
||||
await websocket.send(ujson.dumps({
|
||||
"action": "init_jobs",
|
||||
|
|
Loading…
Add table
Reference in a new issue