|
@@ -68,16 +68,16 @@ class Job(object):
|
|
|
def initPool():
|
|
|
if Job.pool:
|
|
|
maxthreads = Job.maxthreads
|
|
|
- queued = Job.queued()
|
|
|
running = len(Job.running())
|
|
|
if maxthreads > running:
|
|
|
+ queued = Job.queued()
|
|
|
if len(queued) < maxthreads - running:
|
|
|
maxthreads = len(queued)
|
|
|
|
|
|
if maxthreads:
|
|
|
for i in range(0, maxthreads):
|
|
|
- print(queued[i])
|
|
|
- queued[i].start()
|
|
|
+ if len(queued) > i:
|
|
|
+ queued[i].start()
|
|
|
|
|
|
@staticmethod
|
|
|
def finished():
|
|
@@ -332,9 +332,9 @@ class Backup(object):
|
|
|
def __init__(self, config):
|
|
|
self._config = config
|
|
|
self._path = self._config['path']
|
|
|
- self._name = os.path.basename(self._path)
|
|
|
+ self._name = slugify(self._path, max_length=255)
|
|
|
self._logpath = os.path.realpath(os.path.join(
|
|
|
- Backup.logdir, slugify(self._path), 'backup.log'))
|
|
|
+ Backup.logdir, self.name, 'backup.log'))
|
|
|
self._status = Backup.READY
|
|
|
if self.blocking:
|
|
|
self.setStatus(Backup.BLOCKED)
|