Ejemplo n.º 1
0
 def __init__(self, db_name, db_dir):
     from pdagentutil import \
         ensure_readable_directory, ensure_writable_directory
     ensure_readable_directory(db_dir)
     ensure_writable_directory(db_dir)
     self._path = os.path.join(db_dir, db_name)
     self._backup_path = os.path.join(db_dir, "%s.bak" % db_name)
Ejemplo n.º 2
0
 def __init__(self, db_name, db_dir):
     from pdagentutil import \
         ensure_readable_directory, ensure_writable_directory
     ensure_readable_directory(db_dir)
     ensure_writable_directory(db_dir)
     self._path = os.path.join(db_dir, db_name)
     self._backup_path = os.path.join(db_dir, "%s.bak" % db_name)
Ejemplo n.º 3
0
    def __init__(
            self,
            queue_dir,
            lock_class,
            time_calc,
            event_size_max_bytes,
            backoff_interval,
            retry_limit_for_possible_errors,
            backoff_db,
            counter_db
            ):
        PDQueueBase.__init__(self, queue_dir, lock_class, time_calc)

        for ftype in QUEUE_SUBDIRS:
            d = os.path.join(self.queue_dir, ftype)
            ensure_readable_directory(d)
            ensure_writable_directory(d)

        self._dequeue_lockfile = os.path.join(
            self.queue_dir, "dequeue.lock"
            )

        self.event_size_max_bytes = event_size_max_bytes
        self.backoff_info = _BackoffInfo(
            backoff_db,
            backoff_interval,
            retry_limit_for_possible_errors,
            time_calc
            )
        self.counter_info = _CounterInfo(counter_db, time_calc)
Ejemplo n.º 4
0
    def __init__(self, queue_dir, lock_class, time_calc, enqueue_file_mode,
                 default_umask):
        PDQueueBase.__init__(self, queue_dir, lock_class, time_calc)
        self.enqueue_file_mode = enqueue_file_mode
        self.default_umask = default_umask

        # Enqueue needs only write access to the 'tmp' and 'pdq' directories
        ensure_writable_directory(os.path.join(self.queue_dir, "tmp"))
        ensure_writable_directory(os.path.join(self.queue_dir, "pdq"))
Ejemplo n.º 5
0
    def __init__(
            self,
            queue_dir,
            lock_class,
            time_calc,
            enqueue_file_mode,
            default_umask
            ):
        PDQueueBase.__init__(self, queue_dir, lock_class, time_calc)
        self.enqueue_file_mode = enqueue_file_mode
        self.default_umask = default_umask

        # Enqueue needs only write access to the 'tmp' and 'pdq' directories
        ensure_writable_directory(os.path.join(self.queue_dir, "tmp"))
        ensure_writable_directory(os.path.join(self.queue_dir, "pdq"))