diff --git a/README.md b/README.md index 527812a..0a579d3 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Translators: * JSBM for French translation ### Other ### -Script seem to use about 17MB of RAM and negligible amount of CPU when fetching changes. +Script seem to use about 10-17MB of RAM and negligible amount of CPU when fetching changes. Script does not log bot actions by default. "I GoT "Unable to process the event" mESSage!!! WHaT HApND?" - it means there is some kind of action that does not have a template in the script, please [create a ticket](https://gitlab.com/piotrex43/RcGcDw/issues/new?issue%5Bassignee_id%5D=&issue%5Bmilestone_id%5D=) with information on what wiki this error ocurred and when. [Here](https://framapic.org/rVFQD0NQVcok/Ue1SVHHM0e4V.png) is a screenshot of how few embeds look like. diff --git a/rcgcdw.py b/rcgcdw.py index f1c2b0f..37aa49f 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -618,6 +618,8 @@ class recent_changes_class(object): if(time.time() - self.last_downtime)>1800 and self.check_connection(): #check if last downtime happened within 30 minutes, if yes, don't send a message send(_("{wiki} seems to be down or unreachable.").format(wiki=settings["wikiname"]), _("Connection status"), settings["avatars"]["connection_failed"]) self.last_downtime = time.time() + def clear_cache(self): + self.map_ips = {} recent_changes = recent_changes_class() recent_changes.fetch(amount=settings["limitrefetch" ] if settings["limitrefetch"] != -1 else settings["limit"]) @@ -631,11 +633,8 @@ if settings["overview"]: diff = (datetime.datetime.now().hour - datetime.datetime.utcnow().hour, datetime.datetime.now().minute - datetime.datetime.utcnow().minute) tim = (ovUTC_time[0]+diff[0], ovUTC_time[1]+diff[1]) schedule.every().day.at("{}:{}".format(int(math.fabs(tim[0])), int(math.fabs(tim[1])))).do(day_overview) +schedule.every().day.at("00:00").do(recent_changes.clear_cache) while 1: time.sleep(1.0) schedule.run_pending() - #if (recent_changes.day != ): - #logging.info("A brand new day! Printing the summary and clearing the cache") - ##recent_changes.clear_cache() - #recent_changes.day = datetime.datetime.now().day