'When we receive a health response, update the health status.'

def on_health_response(self, response):

    if (not self):
        return
    self.has_health = True
    total_seeders = 0
    total_leechers = 0
    if ((not response) or ('error' in response)):
        self.update_health(0, 0)
        return
    for (_, status) in response['health'].iteritems():
        if ('error' in status):
            continue
        total_seeders += int(status['seeders'])
        total_leechers += int(status['leechers'])
    self.is_health_checking = False
    self.update_health(total_seeders, total_leechers)
