Exemplo n.º 1
0
Arquivo: horde.py Projeto: Bamco/pyres
 def _add_minion(self):
     if hasattr(self,'logger'):
         self.logger.info('Adding minion')
     if self.log_file:
         if special_log_file(self.log_file):
             log_path = self.log_file
         else:
             log_path = os.path.dirname(self.log_file)
     else:
         log_path = None
     m = Minion(self.queues, self.server, self.password, log_level=self.logging_level, log_path=log_path)
     m.start()
     self._workers[m.pid] = m
     if hasattr(self,'logger'):
         self.logger.info('minion added at: %s' % m.pid)
     return m
Exemplo n.º 2
0
 def _add_minion(self):
     if hasattr(self,'logger'):
         self.logger.info('Adding minion')
     if self.log_file:
         if special_log_file(self.log_file):
             log_path = self.log_file
         else:
             log_path = os.path.dirname(self.log_file)
     else:
         log_path = None
     m = Minion(self.queues, self.server, self.password, interval=self.minions_interval,
                log_level=self.logging_level, log_path=log_path, concat_logs=self.concat_minions_logs,
                max_jobs=self.max_jobs)
     m.start()
     self._workers[m.pid] = m
     if hasattr(self,'logger'):
         self.logger.info('minion added at: %s' % m.pid)
     return m
Exemplo n.º 3
0
Arquivo: horde.py Projeto: Bamco/pyres
    def run(self):
        setproctitle('pyres_minion:%s: Starting' % (os.getppid(),))
        if self.log_path:
            if special_log_file(self.log_path):
                self.log_file = self.log_path
            else:
                self.log_file = os.path.join(self.log_path, 'minion-%s.log' % self.pid)
        namespace = 'minion:%s' % self.pid
        self.logger = setup_logging('minion', namespace, self.log_level, self.log_file)
        #self.clear_logger()
        if isinstance(self.server,string_types):
            self.resq = ResQ(server=self.server, password=self.password)
        elif isinstance(self.server, ResQ):
            self.resq = self.server
        else:
            raise Exception("Bad server argument")


        self.work()
Exemplo n.º 4
0
    def run(self):
        setproctitle('pyres_minion:%s: Starting' % (os.getppid(), ))
        if self.log_path:
            if special_log_file(self.log_path):
                self.log_file = self.log_path
            else:
                self.log_file = os.path.join(self.log_path,
                                             'minion-%s.log' % self.pid)
        namespace = 'minion:%s' % self.pid
        self.logger = setup_logging('minion', namespace, self.log_level,
                                    self.log_file)
        #self.clear_logger()
        if isinstance(self.server, string_types):
            self.resq = ResQ(server=self.server, password=self.password)
        elif isinstance(self.server, ResQ):
            self.resq = self.server
        else:
            raise Exception("Bad server argument")

        self.work()