(self)
return max(datetime.datetime.utcnow() - self.get_last_seen() - HEARTBEAT_FREQUENCY,
                   datetime.timedelta(seconds=0))
Estimate the amount of time the queue has been blocked

        :returns a timedelta or raises HeartbeatNeverRecorded
Estimate the amount of time the queue has been blocked
Estimate the amount of time the queue has been blocked
def get_blockage_duration(self):
        """
        Estimate the amount of time the queue has been blocked

        :returns a timedelta or raises HeartbeatNeverRecorded
        """
        # Subtract off the time between heartbeats
        # since we don't know how long it's been since the last heartbeat
        return max(datetime.datetime.utcnow() - self.get_last_seen() - HEARTBEAT_FREQUENCY,
                   datetime.timedelta(seconds=0))
def get_blockage_duration ( self ) : # Subtract off the time between heartbeats # since we don't know how long it's been since the last heartbeat return max ( datetime . datetime . utcnow ( ) - self . get_last_seen ( ) - HEARTBEAT_FREQUENCY , datetime . timedelta ( seconds = 0 ) )