Skip to content

Commit

Permalink
Better reproting of maxtime issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Huji committed Jan 4, 2025
1 parent e595047 commit d7951ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions HujiBot/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,14 @@ def run(self):
cursor.execute(max_len)
try:
cursor.execute(self.sql)
except Exception:
print("Query took too long therefore StatBot was stopped!")
except Exception as ex:
bot_end = time.time()
pywikibot.output(
"Start time: %s" % time.asctime(time.gmtime(bot_end))
)
pywikibot.output("Maxtime was set to %d" % self.maxtime)
print("Query error or taking took too long. StatBot was stopped!")
print(ex)
return
results = cursor.fetchall()
query_end = time.time()
Expand Down

0 comments on commit d7951ee

Please sign in to comment.