def check(self, instance):
        if not self.pool_started:
            self.start_pool()
        if 5 * self.pool_size + 5 > threading.activeCount(): # On Windows the agent runs on multiple threads so we need to have an offset of 5 in case the pool_size is 1
            raise Exception("Thread number (%s) is exploding. Skipping this check" % threading.activeCount())
        self._process_results()
        self._clean()
        name = instance.get('name', None)
        if name is None:
            self.log.error('Each service check must have a name')
            return

        if name not in self.jobs_status:
            # A given instance should be processed one at a time
            self.jobs_status[name] = time.time()
            self.pool.apply_async(self._process, args=(instance,))
        else:
            self.log.error("Instance: %s skipped because it's already running." % name)
dataset/ETHPy150Open serverdensity/sd-agent/checks/network_checks.py/NetworkCheck.check/swapped operands of `>`