Spaces:
Runtime error
Runtime error
Commit
·
c92a43f
1
Parent(s):
b29af5a
Update main.py
Browse files
main.py
CHANGED
@@ -217,9 +217,10 @@ queuedUnSummurizedShawkas = []
|
|
217 |
semphoreShakwas=threading.Semaphore(0)
|
218 |
def summrizedshakwas():
|
219 |
while True:
|
220 |
-
semphoreShakwas.acquire()
|
221 |
global queuedUnSummurizedShawkas
|
222 |
global semphoreShakwas
|
|
|
|
|
223 |
shawka=queuedUnSummurizedShawkas.pop(0)
|
224 |
tmpdict= modelsummary(shawka.complaintbody)
|
225 |
shawka.summary=tmpdict['summary']
|
@@ -231,12 +232,12 @@ thread.start()
|
|
231 |
callback_done = threading.Event()
|
232 |
def on_snapshot(doc_snapshot, changes, read_time):
|
233 |
for doc in doc_snapshot:
|
234 |
-
global queuedUnSummurizedShawkas
|
235 |
-
global semphoreShakwas
|
236 |
# print(doc.to_dict())
|
237 |
shakw = Classes.Shakwa.from_dict(source=doc.to_dict())
|
238 |
shakw.complaintbody
|
239 |
if shakw.summary==None:
|
|
|
|
|
240 |
queuedUnSummurizedShawkas.append(shakw)
|
241 |
semphoreShakwas.release()
|
242 |
callback_done.set()
|
|
|
217 |
semphoreShakwas=threading.Semaphore(0)
|
218 |
def summrizedshakwas():
|
219 |
while True:
|
|
|
220 |
global queuedUnSummurizedShawkas
|
221 |
global semphoreShakwas
|
222 |
+
semphoreShakwas.acquire()
|
223 |
+
|
224 |
shawka=queuedUnSummurizedShawkas.pop(0)
|
225 |
tmpdict= modelsummary(shawka.complaintbody)
|
226 |
shawka.summary=tmpdict['summary']
|
|
|
232 |
callback_done = threading.Event()
|
233 |
def on_snapshot(doc_snapshot, changes, read_time):
|
234 |
for doc in doc_snapshot:
|
|
|
|
|
235 |
# print(doc.to_dict())
|
236 |
shakw = Classes.Shakwa.from_dict(source=doc.to_dict())
|
237 |
shakw.complaintbody
|
238 |
if shakw.summary==None:
|
239 |
+
global queuedUnSummurizedShawkas
|
240 |
+
global semphoreShakwas
|
241 |
queuedUnSummurizedShawkas.append(shakw)
|
242 |
semphoreShakwas.release()
|
243 |
callback_done.set()
|