提交 9ea7dd5f 编写于 作者: M Mark Hymers

Merge commit 'ftpmaster/master'

......@@ -193,7 +193,7 @@ GO=(
ARGS=""
ERR="false"
)
stage $GO &
stage $GO
GO=(
FUNC="i18n1"
......@@ -201,7 +201,7 @@ GO=(
ARGS=""
ERR="false"
)
stage $GO &
stage $GO
lockfile "$LOCK_ACCEPTED"
lockfile "$LOCK_NEW"
......@@ -265,7 +265,7 @@ GO=(
ARGS=""
ERR="false"
)
stage $GO &
stage $GO
GO=(
FUNC="overrides"
......@@ -281,7 +281,7 @@ GO=(
ARGS=""
ERR="false"
)
stage $GO &
stage $GO
state "packages/contents"
GO=(
......
......@@ -125,7 +125,7 @@ Rm
};
MyEmailAddress "Debian Archive Maintenance <ftpmaster@ftp-master.debian.org>";
LogFile "/srv/ftp-master.debian.org/web/removals.txt";
LogFile "/srv/ftp.debian.org/web/removals.txt";
Bcc "removed-packages@qa.debian.org";
};
......@@ -653,3 +653,9 @@ Contents
Header "contents";
Root "/srv/ftp-master.debian.org/test/";
}
Common
{
// The default number of threads for multithreading parts of dak:
ThreadCount 16;
}
......@@ -143,7 +143,8 @@ def html_footer():
################################################################################
def do_pkg(changes_file, session):
def do_pkg(changes_file):
session = DBConn().session()
u = Upload()
u.pkg.changes_file = changes_file
(u.pkg.changes["fingerprint"], rejects) = utils.check_signature(changes_file)
......@@ -194,6 +195,7 @@ def do_pkg(changes_file, session):
if sys.stdout != stdout_fd:
sys.stdout.close()
sys.stdout = stdout_fd
session.close()
################################################################################
......@@ -245,7 +247,7 @@ def main():
if not changes_file:
continue
print "\n" + changes_file
do_pkg (changes_file, session)
do_pkg (changes_file)
files = set(os.listdir(cnf["Show-New::HTMLPath"]))
to_delete = filter(lambda x: x.endswith(".html"), files.difference(sources))
......
import threading
from time import sleep
from daklib.config import Config
# This code is a modified copy of
# http://code.activestate.com/recipes/203871-a-generic-programming-thread-pool/
# and is licensed under the Python License. The full text of the license
# is available in the file COPYING-PSF.
# FIXME:
# numThreads defaults to 16 in __init__ to work best on
# franck.debian.org but the default value should be specified in
# dak.conf
# Ensure booleans exist (not needed for Python 2.2.1 or higher)
try:
True
......@@ -18,16 +15,25 @@ except NameError:
False = 0
True = not False
if Config().has_key('Common::ThreadCount'):
defaultThreadCount = int(Config()['Common::ThreadCount'])
else:
defaultThreadCount = 1
class ThreadPool:
"""Flexible thread pool class. Creates a pool of threads, then
accepts tasks that will be dispatched to the next available
thread."""
accepts tasks that will be dispatched to the next available thread.
The argument numThreads defaults to 'Common::ThreadCount' which must
be specified in dak.conf."""
def __init__(self, numThreads = 16):
def __init__(self, numThreads = 0):
"""Initialize the thread pool with numThreads workers."""
if numThreads == 0:
numThreads = defaultThreadCount
self.__threads = []
self.__resizeLock = threading.Condition(threading.Lock())
self.__taskLock = threading.Condition(threading.Lock())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册