'Called when the process intializes.'

def run(self):

    logger.info('started    worker')
    FULL_NAMESPACE = settings.FULL_NAMESPACE
    MINI_NAMESPACE = settings.MINI_NAMESPACE
    MAX_RESOLUTION = settings.MAX_RESOLUTION
    full_uniques = (FULL_NAMESPACE + 'unique_metrics')
    mini_uniques = (MINI_NAMESPACE + 'unique_metrics')
    pipe = self.redis_conn.pipeline()
    while 1:
        try:
            self.redis_conn.ping()
        except:
            logger.error(("worker    can't    connect    to    redis    at    socket    path    %s" % settings.REDIS_SOCKET_PATH))
            sleep(10)
            self.redis_conn = StrictRedis(unix_socket_path=settings.REDIS_SOCKET_PATH)
            pipe = self.redis_conn.pipeline()
            continue
        try:
            chunk = self.q.get(True, 15)
            now = time()
            for metric in chunk:
                if self.in_skip_list(metric[0]):
                    continue
                if (metric[1][0] < (now - MAX_RESOLUTION)):
                    continue
                key = ''.join((FULL_NAMESPACE, metric[0]))
                pipe.append(key, packb(metric[1]))
                pipe.sadd(full_uniques, key)
                if (not self.skip_mini):
                    mini_key = ''.join((MINI_NAMESPACE, metric[0]))
                    pipe.append(mini_key, packb(metric[1]))
                    pipe.sadd(mini_uniques, mini_key)
                pipe.execute()
            if self.canary:
                logger.info(('queue    size    at    %d' % self.q.qsize()))
                self.send_graphite_metric('skyline.horizon.queue_size', self.q.qsize())
        except Empty:
            logger.info('worker    queue    is    empty    and    timed    out')
        except WatchError:
            logger.error(key)
        except NotImplementedError:
            pass
        except Exception as e:
            logger.error(('worker    error:    ' + str(e)))
