[Streams] Fix excessive writes to config (#2095)

Resolves #2052.
This commit is contained in:
palmtree5 2018-09-03 17:01:48 -08:00 committed by Toby Harradine
parent 85354f2722
commit 589041556e

View File

@ -508,6 +508,8 @@ class Streams:
try: try:
embed = await stream.is_online() embed = await stream.is_online()
except OfflineStream: except OfflineStream:
if not stream._messages_cache:
continue
for message in stream._messages_cache: for message in stream._messages_cache:
try: try:
autodelete = await self.db.guild(message.guild).autodelete() autodelete = await self.db.guild(message.guild).autodelete()
@ -558,6 +560,8 @@ class Streams:
print(_("The Community {} was not found!").format(community.name)) print(_("The Community {} was not found!").format(community.name))
continue continue
except OfflineCommunity: except OfflineCommunity:
if not community._messages_cache:
continue
for message in community._messages_cache: for message in community._messages_cache:
try: try:
autodelete = await self.db.guild(message.guild).autodelete() autodelete = await self.db.guild(message.guild).autodelete()