mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Updated with current state, fixed irc crash on bytes (non-critical)
This commit is contained in:
parent
92d39d451c
commit
9255238389
|
@ -1146,6 +1146,7 @@ async def embed_formatter(action, change, parsed_comment, categories, recent_cha
|
||||||
tag_displayname.append(additional_data["tags"][tag])
|
tag_displayname.append(additional_data["tags"][tag])
|
||||||
else:
|
else:
|
||||||
tag_displayname.append(tag)
|
tag_displayname.append(tag)
|
||||||
|
if tag_displayname:
|
||||||
embed.add_field(_("Tags"), ", ".join(tag_displayname))
|
embed.add_field(_("Tags"), ", ".join(tag_displayname))
|
||||||
if len(embed["title"]) > 254:
|
if len(embed["title"]) > 254:
|
||||||
embed["title"] = embed["title"][0:253]+"…"
|
embed["title"] = embed["title"][0:253]+"…"
|
||||||
|
|
|
@ -65,6 +65,8 @@ class AioIRCCat(irc.client_aio.AioSimpleIRCClient):
|
||||||
logger.warning("Seems like we have invalid JSON in Discussions part, message: {}".format(message))
|
logger.warning("Seems like we have invalid JSON in Discussions part, message: {}".format(message))
|
||||||
return
|
return
|
||||||
if post.get('action', 'unknown') != "deleted": # ignore deletion events
|
if post.get('action', 'unknown') != "deleted": # ignore deletion events
|
||||||
|
if isinstance(post.get('url'), bytes):
|
||||||
|
return
|
||||||
url = urlparse(post.get('url'))
|
url = urlparse(post.get('url'))
|
||||||
full_url ="https://"+ url.netloc + recognize_langs(url.path)
|
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
|
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
|
||||||
|
|
|
@ -89,7 +89,7 @@ class Wiki:
|
||||||
async def fail_add(self, wiki_url, status):
|
async def fail_add(self, wiki_url, status):
|
||||||
logger.debug("Increasing fail_times to {}".format(self.fail_times+3))
|
logger.debug("Increasing fail_times to {}".format(self.fail_times+3))
|
||||||
self.fail_times += 3
|
self.fail_times += 3
|
||||||
if self.fail_times > 9:
|
if self.fail_times > 120:
|
||||||
await self.remove(wiki_url, status)
|
await self.remove(wiki_url, status)
|
||||||
|
|
||||||
async def check_status(self, wiki_url, status):
|
async def check_status(self, wiki_url, status):
|
||||||
|
|
Loading…
Reference in a new issue