Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡️ Perf tweaks per suspicions #97

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/iembot/webservices.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
rm = f"{rm[-3:]}chat"
elif len(rm) == 3:
rm = f"k{rm}chat"
if rm not in iembot.chatlog:
return ""
if rm not in XML_CACHE:
XML_CACHE[rm] = ""
XML_CACHE_EXPIRES[rm] = -2
if rm not in iembot.chatlog:
return ""
# should not be empty given the caller
lastID = iembot.chatlog[rm][0].seqnum
if lastID == XML_CACHE_EXPIRES[rm]:
Expand All @@ -45,7 +45,7 @@

XML_CACHE[rm] = rss.rss_str()
XML_CACHE_EXPIRES[rm] = lastID
return rss.rss_str()
return XML_CACHE[rm]

Check warning on line 48 in src/iembot/webservices.py

View check run for this annotation

Codecov / codecov/patch

src/iembot/webservices.py#L48

Added line #L48 was not covered by tests


class RSSService(resource.Resource):
Expand Down