mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Remove some old debug code
This commit is contained in:
parent
fcdf6b66cf
commit
98cb381d55
|
@ -162,12 +162,12 @@ class RcQueue:
|
||||||
try:
|
try:
|
||||||
current_domain: dict = self[domain]
|
current_domain: dict = self[domain]
|
||||||
if current_domain["irc"]:
|
if current_domain["irc"]:
|
||||||
logger.debug('CURRENT STATUS:')
|
|
||||||
logger.debug("DOMAIN LIST FOR IRC: {}".format(current_domain["irc"].updated))
|
logger.debug("DOMAIN LIST FOR IRC: {}".format(current_domain["irc"].updated))
|
||||||
logger.debug("CURRENT DOMAIN INFO: {}".format(domain))
|
logger.debug("CURRENT DOMAIN INFO: {}".format(domain))
|
||||||
logger.debug("IS WIKI IN A LIST?: {}".format(db_wiki["wiki"] in current_domain["irc"].updated))
|
logger.debug("IS WIKI IN A LIST?: {}".format(db_wiki["wiki"] in current_domain["irc"].updated))
|
||||||
logger.debug("LAST CHECK FOR THE WIKI {} IS {}".format(db_wiki["wiki"], all_wikis[db_wiki["wiki"]].last_check))
|
logger.debug("LAST CHECK FOR THE WIKI {} IS {}".format(db_wiki["wiki"], all_wikis[db_wiki["wiki"]].last_check))
|
||||||
if db_wiki["wiki"] not in current_domain["irc"].updated and all_wikis[db_wiki["wiki"]].last_check+settings["irc_overtime"] > time.time():
|
if db_wiki["wiki"] not in current_domain["irc"].updated and all_wikis[db_wiki["wiki"]].last_check+settings["irc_overtime"] > time.time():
|
||||||
|
logger.debug('Skipping wiki {}'.format(db_wiki["wiki"]))
|
||||||
continue # if domain has IRC, has not been updated, and it was updated less than an hour ago
|
continue # if domain has IRC, has not been updated, and it was updated less than an hour ago
|
||||||
else: # otherwise remove it from the list
|
else: # otherwise remove it from the list
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -145,10 +145,10 @@ async def process_cats(event: dict, local_wiki: Wiki, category_msgs: dict, categ
|
||||||
wiki_cat_mw_messages = category_msgs[local_wiki.mw_messages]
|
wiki_cat_mw_messages = category_msgs[local_wiki.mw_messages]
|
||||||
if wiki_cat_mw_messages[0][1] in comment_to_match or wiki_cat_mw_messages[2][1] in comment_to_match: # Added to category
|
if wiki_cat_mw_messages[0][1] in comment_to_match or wiki_cat_mw_messages[2][1] in comment_to_match: # Added to category
|
||||||
categorize_events[event["revid"]]["new"].add(cat_title)
|
categorize_events[event["revid"]]["new"].add(cat_title)
|
||||||
logger.debug("Matched {} to added category for {}".format(cat_title, event["revid"]))
|
#logger.debug("Matched {} to added category for {}".format(cat_title, event["revid"]))
|
||||||
elif wiki_cat_mw_messages[1][1] in comment_to_match or wiki_cat_mw_messages[3][1] in comment_to_match: # Removed from category
|
elif wiki_cat_mw_messages[1][1] in comment_to_match or wiki_cat_mw_messages[3][1] in comment_to_match: # Removed from category
|
||||||
categorize_events[event["revid"]]["removed"].add(cat_title)
|
categorize_events[event["revid"]]["removed"].add(cat_title)
|
||||||
logger.debug("Matched {} to removed category for {}".format(cat_title, event["revid"]))
|
#logger.debug("Matched {} to removed category for {}".format(cat_title, event["revid"]))
|
||||||
else:
|
else:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Unknown match for category change with messages {}, {}, {}, {} and comment_to_match {}".format(
|
"Unknown match for category change with messages {}, {}, {}, {} and comment_to_match {}".format(
|
||||||
|
@ -197,7 +197,7 @@ async def essential_info(change: dict, changed_categories, local_wiki: Wiki, tar
|
||||||
"""Prepares essential information for both embed and compact message format."""
|
"""Prepares essential information for both embed and compact message format."""
|
||||||
_ = langs[target[0][0]]["wiki"].gettext
|
_ = langs[target[0][0]]["wiki"].gettext
|
||||||
changed_categories = changed_categories.get(change["revid"], None)
|
changed_categories = changed_categories.get(change["revid"], None)
|
||||||
logger.debug("List of categories in essential_info: {}".format(changed_categories))
|
#logger.debug("List of categories in essential_info: {}".format(changed_categories))
|
||||||
appearance_mode = embed_formatter if target[0][1] > 0 else compact_formatter
|
appearance_mode = embed_formatter if target[0][1] > 0 else compact_formatter
|
||||||
if "actionhidden" in change or "suppressed" in change: # if event is hidden using suppression
|
if "actionhidden" in change or "suppressed" in change: # if event is hidden using suppression
|
||||||
await appearance_mode("suppressed", change, "", changed_categories, local_wiki, target, paths, rate_limiter)
|
await appearance_mode("suppressed", change, "", changed_categories, local_wiki, target, paths, rate_limiter)
|
||||||
|
|
|
@ -9,11 +9,11 @@ class RateLimiter:
|
||||||
def timeout_add(self, timeout: float):
|
def timeout_add(self, timeout: float):
|
||||||
"""This function sets a new timeout"""
|
"""This function sets a new timeout"""
|
||||||
self.timeout_until = time.time() + timeout
|
self.timeout_until = time.time() + timeout
|
||||||
logger.debug("Added {} timeout".format(timeout))
|
#logger.debug("Added {} timeout".format(timeout))
|
||||||
|
|
||||||
async def timeout_wait(self):
|
async def timeout_wait(self):
|
||||||
"""This awaitable calculates the time to wait according to timeout_until, does not wait if it's past the timeout to not skip a cycle"""
|
"""This awaitable calculates the time to wait according to timeout_until, does not wait if it's past the timeout to not skip a cycle"""
|
||||||
calculated_timeout = self.timeout_until - time.time()
|
calculated_timeout = self.timeout_until - time.time()
|
||||||
logger.debug("Waiting {}".format(calculated_timeout))
|
#logger.debug("Waiting {}".format(calculated_timeout))
|
||||||
if calculated_timeout > 0:
|
if calculated_timeout > 0:
|
||||||
await asyncio.sleep(calculated_timeout)
|
await asyncio.sleep(calculated_timeout)
|
||||||
|
|
Loading…
Reference in a new issue