diff options
author | Helmut Grohne <helmut@subdivi.de> | 2013-06-11 23:22:10 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2013-06-11 23:22:10 +0200 |
commit | f652c17f242fb743a167041521e9618039ae7296 (patch) | |
tree | 6e88fd70726bd636af375f67d4e9f5caa83db7ee /autoimport.py | |
parent | ee63a5ca909065a4317931eed6be2140fc48754c (diff) | |
download | debian-dedup-f652c17f242fb743a167041521e9618039ae7296.tar.gz |
autoimport: don't fork for readyaml
This appears to be a huge performance boost.
Diffstat (limited to 'autoimport.py')
-rwxr-xr-x | autoimport.py | 8 |
1 files changed, 5 insertions, 3 deletions
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) |