bichnhan2701 commited on
Commit
c846dab
·
1 Parent(s): ab5e094

update note events

Browse files
Files changed (1) hide show
  1. app/api/notes/notes_events.py +3 -8
app/api/notes/notes_events.py CHANGED
@@ -27,14 +27,9 @@ async def note_events(note_id: str):
27
  note = get_note(note_id)
28
 
29
  if not note:
30
- yield {
31
- "event": "error",
32
- "data": json.dumps({
33
- "note_id": note_id,
34
- "status": "not_found",
35
- }),
36
- }
37
- break
38
 
39
  status = note.get("status")
40
 
 
27
  note = get_note(note_id)
28
 
29
  if not note:
30
+ # note chưa được tạo, chờ
31
+ await asyncio.sleep(0.5)
32
+ continue
 
 
 
 
 
33
 
34
  status = note.get("status")
35