def run(self): self.logger.debug("Starting EngineActiveMarkerTask.") # to protect against other imports from virusscan.models import ScannerType, get_active_q_dict_from_cache active_queues = get_active_q_dict_from_cache(inspect=self.app.control.inspect()) self.logger.debug("Setting active queues\n'{0}'.".format(active_queues)) ScannerType.objects.set_active_by_q_dict(active_queues)
def run(self): self.logger.debug("Starting EngineActiveMarkerTask.") # to protect against other imports from virusscan.models import ScannerType, get_active_q_dict_from_cache active_queues = get_active_q_dict_from_cache( inspect=self.app.control.inspect()) self.logger.debug( "Setting active queues\n'{0}'.".format(active_queues)) ScannerType.objects.set_active_by_q_dict(active_queues)
def on_shutter(self, state): if not state.event_count: # No new events since last snapshot. return current_worker_count = len(state.alive_workers()) if self.last_alive_workers != current_worker_count: active_queues = get_active_q_dict_from_cache(inspect=self.app.control.inspect()) ScannerType.objects.set_active_by_q_dict(active_queues) self.last_alive_workers = current_worker_count
def on_shutter(self, state): if not state.event_count: # No new events since last snapshot. return current_worker_count = len(state.alive_workers()) if self.last_alive_workers != current_worker_count: active_queues = get_active_q_dict_from_cache( inspect=self.app.control.inspect()) ScannerType.objects.set_active_by_q_dict(active_queues) self.last_alive_workers = current_worker_count