improved querying

This commit is contained in:
Klemek
2021-03-16 16:11:40 +01:00
parent 3e781c746f
commit e72a7ccfa6
2 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import discord
from . import MessageLog
from utils import FakeMessage
CHUNK_SIZE = 1000
CHUNK_SIZE = 2000
FORMAT = 3
+10 -2
View File
@@ -172,16 +172,24 @@ class GuildLogs:
await asyncio.sleep(0.5)
total_chan = sum([worker.done for worker in workers])
remaining = [
worker.channel.name for worker in workers if not worker.done
]
total_chan = max_chan - len(remaining)
queried_msg = sum([worker.queried_msg for worker in workers])
total_msg = sum([worker.total_msg for worker in workers])
if total_chan == max_chan:
done = True
remaining_msg = ""
if len(remaining) <= 5:
remaining_msg = "\nRemaining: " + ", ".join(remaining)
await code_message(
progress,
f"Reading new history...\n{total_msg:,} messages in {total_chan:,}/{max_chan:,} channels ({round(queried_msg/deltas(t0)):,}m/s)\n{warning_msg}",
f"Reading new history...\n{total_msg:,} messages in {total_chan:,}/{max_chan:,} channels ({round(queried_msg/deltas(t0)):,}m/s)\n{warning_msg}{remaining_msg}",
)
logging.info(
f"log {self.guild.id} > queried in {delta(t0):,}ms -> {queried_msg / deltas(t0):,.3f} m/s"