Updated with current state, fixed irc crash on bytes (non-critical)

This commit is contained in:
Frisk 2022-09-29 23:39:44 +02:00
parent 92d39d451c
commit 9255238389
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
3 changed files with 5 additions and 2 deletions

View file

@ -1146,7 +1146,8 @@ async def embed_formatter(action, change, parsed_comment, categories, recent_cha
tag_displayname.append(additional_data["tags"][tag])
else:
tag_displayname.append(tag)
embed.add_field(_("Tags"), ", ".join(tag_displayname))
if tag_displayname:
embed.add_field(_("Tags"), ", ".join(tag_displayname))
if len(embed["title"]) > 254:
embed["title"] = embed["title"][0:253]+""
logger.debug("Current params in edit action: {}".format(change))

View file

@ -65,6 +65,8 @@ class AioIRCCat(irc.client_aio.AioSimpleIRCClient):
logger.warning("Seems like we have invalid JSON in Discussions part, message: {}".format(message))
return
if post.get('action', 'unknown') != "deleted": # ignore deletion events
if isinstance(post.get('url'), bytes):
return
url = urlparse(post.get('url'))
full_url ="https://"+ url.netloc + recognize_langs(url.path)
if full_url in self.wikis: # POSSIBLE MEMORY LEAK AS WE DON'T HAVE A WAY TO CHECK IF WIKI IS LOOKING FOR DISCUSSIONS OR NOT

View file

@ -89,7 +89,7 @@ class Wiki:
async def fail_add(self, wiki_url, status):
logger.debug("Increasing fail_times to {}".format(self.fail_times+3))
self.fail_times += 3
if self.fail_times > 9:
if self.fail_times > 120:
await self.remove(wiki_url, status)
async def check_status(self, wiki_url, status):