threading: improve variable names and factorize code

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht
2016-05-18 02:42:09 +02:00
parent 0addcbabf0
commit e0fdcb3852
5 changed files with 29 additions and 24 deletions

View File

@ -134,7 +134,7 @@ class BaseFolder(object):
return True
def getcopyinstancelimit(self):
def getinstancelimitnamespace(self):
"""For threading folders, returns the instancelimitname for
InstanceLimitedThreads."""
@ -872,7 +872,7 @@ class BaseFolder(object):
if self.suggeststhreads() and not globals.options.singlethreading:
self.waitforthread()
thread = threadutil.InstanceLimitedThread(
self.getcopyinstancelimit(),
self.getinstancelimitnamespace(),
target = self.copymessageto,
name = "Copy message from %s:%s" % (self.repository, self),
args = (uid, dstfolder, statusfolder)