fix for deleted servers
This commit is contained in:
parent
8e97808ef0
commit
c2542b0840
@ -77,8 +77,9 @@ class Poll:
|
||||
|
||||
async def is_open(self, update_db=True):
|
||||
if self.server is None:
|
||||
self.open = True
|
||||
return
|
||||
if open and self.duration != 0 \
|
||||
if self.open and self.duration != 0 \
|
||||
and datetime.datetime.utcnow().replace(tzinfo=pytz.utc) > self.get_duration_with_tz():
|
||||
self.open = False
|
||||
if update_db:
|
||||
@ -87,6 +88,7 @@ class Poll:
|
||||
|
||||
async def is_active(self, update_db=True):
|
||||
if self.server is None:
|
||||
self.active = False
|
||||
return
|
||||
if not self.active and self.activation != 0 \
|
||||
and datetime.datetime.utcnow().replace(tzinfo=pytz.utc) > self.get_activation_with_tz():
|
||||
|
||||
@ -59,9 +59,10 @@ class PollControls:
|
||||
logger.warning("Attribute Error in close_polls loop")
|
||||
logger.exception(ae)
|
||||
pass
|
||||
except:
|
||||
except Exception as ex:
|
||||
#Never break this loop due to an error
|
||||
logger.error("Other Error in close_polls loop")
|
||||
logger.exception(ex)
|
||||
pass
|
||||
|
||||
await asyncio.sleep(30)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user