def _updateLastEventId(self, event):
    BACKLOG_TIMEOUT = 5
    if ((self._lastEventId is not None) and (event['id'] > (self._lastEventId + 1))):
        event_date = event['created_at'].replace(tzinfo=None)
        if (datetime.datetime.now() > (event_date + datetime.timedelta(minutes=BACKLOG_TIMEOUT))):
            if (event['id'] == (self._lastEventId + 2)):
                self.logger.info('Event %d never happened - ignoring.', (self._lastEventId + 1))
            else:
                self.logger.info('Events %d-%d never happened - ignoring.', (self._lastEventId + 1), (event['id'] - 1))
        else:
            expiration = (datetime.datetime.now() + datetime.timedelta(minutes=BACKLOG_TIMEOUT))
            for skippedId in range((self._lastEventId + 1), event['id']):
                self.logger.info('Adding event id %d to backlog.', skippedId)
                self._backlog[skippedId] = expiration
    self._lastEventId = event['id']
def _updateLastEventId(self, event):
    BACKLOG_TIMEOUT = 5
    if ((self._lastEventId is not None) and (event['id'] > (self._lastEventId + 1))):
        event_date = event['created_at'].replace(tzinfo=None)
        if (datetime.datetime.now() > (event_date + datetime.timedelta(minutes=BACKLOG_TIMEOUT))):
            if (event['id'] == (self._lastEventId + 2)):
                self.logger.info('Event %d never happened - ignoring.', (self._lastEventId + 1))
            else:
                self.logger.info('Events %d-%d never happened - ignoring.', (self._lastEventId + 1), (event['id'] - 1))
        else:
            expiration = (datetime.datetime.now() + datetime.timedelta(minutes=BACKLOG_TIMEOUT))
            for skippedId in range((self._lastEventId + 1), event['id']):
                self.logger.info('Adding event id %d to backlog.', skippedId)
                self._backlog[skippedId] = expiration
    self._lastEventId = event['id']