def enqueue_unique_from_string(self, klass_as_string, queue, args=None, key=None): if not self.add_unique_key(queue, key): logger.debug('key %s already enqueued' % key) return if not args: args = [] payload = {'class':klass_as_string, 'queue': queue, 'args':args + [key], 'key':key} self.push(queue, payload) logger.info("enqueued '%s' job on queue %s" % (klass_as_string, queue)) if args: logger.debug("job arguments: %s" % str(args)) else: logger.debug("no arguments passed in.")
def enqueue_unique_from_string(self, klass_as_string, queue, args=None, key=None): if not self.add_unique_key(queue, key): logger.debug('key %s already enqueued' % key) return if not args: args = [] payload = { 'class': klass_as_string, 'queue': queue, 'args': args + [key], 'key': key } self.push(queue, payload) logger.info("enqueued '%s' job on queue %s" % (klass_as_string, queue)) if args: logger.debug("job arguments: %s" % str(args)) else: logger.debug("no arguments passed in.")
def enqueue_unique_from_string(self, klass_as_string, queue, args=None, key=None): if not self.add_unique_key(queue, key): logger.debug("key %s already enqueued", key) return if not args: args = [] payload = { "class": klass_as_string, "queue": queue, "args": args + [key], "key": key, } self.push(queue, payload) logger.info("enqueued '%s' job on queue %s", klass_as_string, queue) if args: logger.debug("job arguments: %s", str(args)) else: logger.debug("no arguments passed in.")
def perform(cls, detection_type, image_path, key): logger.info("Detecting %s for %s", detection_type, image_path) image_data = config.loader.load_sync(image_path) points = cls.processor.detect(detection_type, image_data) result_store = config.store.ResultStore(config) result_store.store(key, points)
def perform(clz, detection_type, image_path, key): logger.info('Detecting %s for %s' % (detection_type, image_path)) image_data = config.loader.load_sync(image_path) points = clz.processor.detect(detection_type, image_data) result_store = config.store.ResultStore(config) result_store.store(key, points)