From f652c17f242fb743a167041521e9618039ae7296 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 11 Jun 2013 23:22:10 +0200 Subject: autoimport: don't fork for readyaml This appears to be a huge performance boost. --- autoimport.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'autoimport.py') diff --git a/autoimport.py b/autoimport.py index 48d3f8c..d326d61 100755 --- a/autoimport.py +++ b/autoimport.py @@ -16,6 +16,8 @@ import concurrent.futures from debian import deb822 from debian.debian_support import version_compare +from readyaml import readyaml + def process_http(pkgs, url): pkglist = urllib.urlopen(url + "/dists/sid/main/binary-amd64/Packages.gz").read() pkglist = gzip.GzipFile(fileobj=io.BytesIO(pkglist)).read() @@ -115,9 +117,9 @@ def main(): print("sqlimporting %s" % name) with open(inf) as inp: try: - subprocess.check_call(["python", "readyaml.py"], stdin=inp) - except subprocess.CalledProcessError: - print("%s failed sql" % name) + readyaml(db, inp) + except Exception as exc: + print("%s failed sql with exception %r" % (name, exc)) else: os.unlink(inf) -- cgit v1.2.3