try:
my_thread1 = threading.Thread(target=start_tg_observer).start()
my_thread2 = threading.Thread(target=start_fb_observer).start()
There is no current event loop in thread 'Thread-1'.
if __name__ == "__main__":
freeze_support()
try:
task = asyncio.get_event_loop(start_tg_observer)
my_thread1 = threading.Thread(target=task).start()
my_thread2 = threading.Thread(target=start_fb_observer).start()
except Exception as e:
pass
def listen_event():
try:
con = create_con()
cond = con.event_conduit(["d_new_event"])
cond.begin()
cond.wait()
async def start_app():
Process(target=start_tg_observer).start()
await Process(target=start_fb_observer).start()
cur = con.cursor()
cur.execute(query)
result = []
for row in cur:
d = dict (id=f"{row[0]}", personal_number=f"{row[1]}", name=f"{row[2]}", group=f"{row[3]}",
position=f" {row[4]}", access=f"{row[5]}", description=f"{row[6]}", card=f"{row[7]}",
start_date=f"{date(row[8])}", end_date=f"{date(row[9])}" )
result.append(d)
return result