Beispiel #1
0
    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.")
Beispiel #2
0
    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.")
Beispiel #3
0
    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.")
Beispiel #4
0
 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)
Beispiel #5
0
 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)