def run_once(self, *a, **kw):
        self.logger.info(_("Beginning log processing"))
        start = time.time()
        already_processed_files = \
            self.log_processor.load_already_processed_files()
        lookback_hours = kw.get('lookback_hours')
        if lookback_hours:
            self.log_processor.lookback_hours = lookback_hours
        lookback_window = kw.get('lookback_window')
        if lookback_window:
            self.log_processor.lookback_window = lookback_window
        logs_to_process = \
            self.log_processor.get_logs_to_process(already_processed_files)
        if not logs_to_process:
            self.logger.info(_("Log processing done (%0.2f minutes)") %
                        ((time.time() - start) / 60))
            return

        # map
        processor_args = (self.conf, self.logger)
        results = multiprocess_collate(AccessLogDelivery, processor_args,
                                       'process_one_file', logs_to_process,
                                       self.worker_count)

        #reduce
        processed_files = already_processed_files
        files_to_upload = set()
        for item, data in results:
            a, c, o = item
            processed_files.add(o)
            if data:
                files_to_upload.update(data)
        len_working_dir = len(self.working_dir) + 1  # +1 for the trailing '/'
        for filename in files_to_upload:
            target_name = filename[len_working_dir:]
            account, target_name = target_name.split('/', 1)
            some_id = uuid4().hex
            target_name = '%s/%s.log.gz' % (target_name, some_id)
            success = self.log_processor.internal_proxy.upload_file(filename,
                            account,
                            self.target_container,
                            target_name)
            if success:
                os.unlink(filename)
                self.logger.debug('Uploaded %s to account %s' % (filename,
                                                                 account))
            else:
                self.logger.error('Could not upload %s to account %s' % (
                                    filename, account))

        # cleanup
        success = self.log_processor.save_processed_files(processed_files)
        if not success:
            self.logger.error('Error uploading updated processed files log')
        self.logger.info(_("Log processing done (%0.2f minutes)") %
                    ((time.time() - start) / 60))
dataset/ETHPy150Open notmyname/slogging/slogging/access_log_delivery.py/AccessLogDeliveryDaemon.run_once/original