'Check that the db is reachable.'

def heartbeat(self):

    if self.database.connection.alive():
        return True
    else:
        raise HeartbeatFailure("Can't    connect    to    {}".format(self.database.name), 'mongo')
