mirror of git://git.acid.vegas/archive.git
Compare commits
3 Commits
faf46ae99d
...
ca2fb50ea1
Author | SHA1 | Date |
---|---|---|
Dionysus | ca2fb50ea1 | |
Dionysus | 6b6d199ccf | |
Dionysus | 142de532c3 |
|
@ -64,11 +64,12 @@ class Bot():
|
|||
if not os.path.exists(FIFO_PATH):
|
||||
os.mkfifo(FIFO_PATH)
|
||||
while True:
|
||||
async with aiofiles.open(FIFO_PATH) as fifo:
|
||||
async with aiofiles.open(FIFO_PATH, mode='r') as fifo:
|
||||
while True:
|
||||
try:
|
||||
for line in fifo:
|
||||
await self.sendmsg(connection.channel, log_line)
|
||||
content = await fifo.readlines()
|
||||
for line in content:
|
||||
await self.sendmsg(connection.channel, line)
|
||||
await asyncio.sleep(0.1)
|
||||
except Exception as ex:
|
||||
try:
|
||||
|
@ -89,7 +90,7 @@ class Bot():
|
|||
'family' : 10 if connection.ipv6 else 2,
|
||||
'local_addr' : connection.vhost
|
||||
}
|
||||
self.reader, self.writer = await asyncio.wait_for(asyncio.open_connection(**options), 30)
|
||||
self.reader, self.writer = await asyncio.wait_for(asyncio.open_connection(**options), 300)
|
||||
await self.raw(f'USER {identity.username} 0 * :{identity.realname}')
|
||||
await self.raw('NICK ' + identity.nickname)
|
||||
except Exception as ex:
|
||||
|
|
Loading…
Reference in New Issue