Update slixfeed.py

This commit is contained in:
Schimon Jehudah 2022-08-14 17:30:35 +00:00
parent 173aeb09cf
commit 19caaf885e

View file

@ -159,8 +159,9 @@ class Slixfeed(slixmpp.ClientXMPP):
async def send_updates(self, event): async def send_updates(self, event):
#while not offline: #while not offline:
#while True: while True:
async with self.lock: #async with self.lock:
await self.lock.acquire()
print(time.strftime("%H:%M:%S")) print(time.strftime("%H:%M:%S"))
# print(offline) # print(offline)
db_dir = get_default_dbdir() db_dir = get_default_dbdir()
@ -182,7 +183,7 @@ class Slixfeed(slixmpp.ClientXMPP):
# d = self.send_ping(self, jid) # d = self.send_ping(self, jid)
# print('d') # print('d')
# print(d) # print(d)
new = await initdb(jid, self.lock, False, get_unread) new = await initdb(jid, False, False, get_unread)
if new: if new:
msg = self.make_message(mto=jid, mbody=new, msg = self.make_message(mto=jid, mbody=new,
mtype='chat') mtype='chat')
@ -201,6 +202,7 @@ class Slixfeed(slixmpp.ClientXMPP):
# mtype='chat') # mtype='chat')
#print(msg) #print(msg)
#msg.send() #msg.send()
self.lock.release()
await asyncio.sleep(60 * 3) await asyncio.sleep(60 * 3)
# asyncio.ensure_future(send_updates(self)) # asyncio.ensure_future(send_updates(self))