youssef1214 commited on
Commit
1daf5e4
1 Parent(s): ffecd68

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -225,7 +225,7 @@ def summrizedshakwas():
225
  tmpdict= modelsummary(shawka.complaintbody)
226
  print(tmpdict)
227
  shawka.summary=tmpdict['summary']
228
- shawka.set_data(db)
229
 
230
  thread = threading.Thread(target=summrizedshakwas)
231
  thread.start()
@@ -239,7 +239,7 @@ def on_snapshot(doc_snapshot, changes, read_time):
239
  # print(doc.to_dict())
240
  shakw = Classes.Shakwa.from_dict(source=doc.to_dict())
241
  shakw.complaintbody
242
- if shakw.summary==None and shakw not in queuedUnSummurizedShawkas :
243
  queuedUnSummurizedShawkas.append(shakw)
244
  semphoreShakwas.release()
245
  callback_done.set()
 
225
  tmpdict= modelsummary(shawka.complaintbody)
226
  print(tmpdict)
227
  shawka.summary=tmpdict['summary']
228
+ db.collection("complaints").document(shawka.id).update({"summary":shawka.summary})
229
 
230
  thread = threading.Thread(target=summrizedshakwas)
231
  thread.start()
 
239
  # print(doc.to_dict())
240
  shakw = Classes.Shakwa.from_dict(source=doc.to_dict())
241
  shakw.complaintbody
242
+ if shakw.summary==None:
243
  queuedUnSummurizedShawkas.append(shakw)
244
  semphoreShakwas.release()
245
  callback_done.set()