offlineimap3
offlineimap3 copied to clipboard
Document reasoning for having maxsyncaccounts
What is the reasoning for having maxsyncaccounts and why is it encouraged to not use this? for security reasons?
Hi @xaverdh
It is related to the number of threads used. See this code in offlineimap/threadutil.py, line 183:
def initInstanceLimit(limitNamespace, instancemax):
"""Initialize the instance-limited thread implementation.
Run up to intancemax threads for the given limitNamespace. This allows to
honor maxsyncaccounts and maxconnections."""
global limitedNamespaces
if limitNamespace not in limitedNamespaces:
limitedNamespaces[limitNamespace] = BoundedSemaphore(instancemax)
The value of `instancemax` is the value of `maxsyncaccounts`, see `init.py`, line 362:
threadutil.initInstanceLimit(
ACCOUNT_LIMITED_THREAD_NAME,
config.getdefaultint('general', 'maxsyncaccounts', 1)
)
I hope this helps. If the answer is ok for you, please, close the issue. If you need more info, do not hesitate to ask.
Best regards, kix.