aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2021-03-05 00:28:23 +0100
committerGravatar Numerlor <[email protected]>2021-03-05 01:42:28 +0100
commited750b03efa792205b1e624e49dd318cda9d1312 (patch)
treebf34c7423d1b73413a3d75076a2323e2f9f6236f
parentDo not set redis results in get_symbol_embed (diff)
Set the result of the future instead of an exception when avaialble
-rw-r--r--bot/exts/info/doc/_batch_parser.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/exts/info/doc/_batch_parser.py b/bot/exts/info/doc/_batch_parser.py
index 45ca17e5e..f5e16a60b 100644
--- a/bot/exts/info/doc/_batch_parser.py
+++ b/bot/exts/info/doc/_batch_parser.py
@@ -141,6 +141,7 @@ class BatchParser:
try:
while self._queue:
item, soup = self._queue.pop()
+ markdown = None
try:
if (future := self._item_futures[item]).done():
# Some items are present in the inventories multiple times under different symbol names,
@@ -154,7 +155,10 @@ class BatchParser:
scheduling.create_task(self.stale_inventory_notifier.send_warning(item))
except Exception as e:
log.exception(f"Unexpected error when handling {item}")
- future.set_exception(e)
+ if markdown is not None:
+ future.set_result(markdown)
+ else:
+ future.set_exception(e)
else:
future.set_result(markdown)
await asyncio.sleep(0.1)