Avoid dispatching when there's no feed updates (#173)
* Avoid dispatching when there's no feed updates * version bump
This commit is contained in:
@@ -25,7 +25,7 @@ from .tag_type import INTERNAL_TAGS, VALID_IMAGES, TagType
|
||||
log = logging.getLogger("red.aikaterna.rss")
|
||||
|
||||
|
||||
__version__ = "1.1.21"
|
||||
__version__ = "1.1.22"
|
||||
|
||||
|
||||
class RSS(commands.Cog):
|
||||
@@ -872,6 +872,10 @@ class RSS(commands.Cog):
|
||||
log.debug(f"Couldn't match anything for feed {name} on cid {channel.id}, only posting 1 post")
|
||||
feedparser_plus_objects = [feedparser_plus_objects[0]]
|
||||
|
||||
if not feedparser_plus_objects:
|
||||
# early-exit so that we don't dispatch when there's no updates
|
||||
return
|
||||
|
||||
# post oldest first
|
||||
feedparser_plus_objects.reverse()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user