Merge branch 'master' of ssh://mikem@git.fedoraproject.org/git/hosted/koji

This commit is contained in:
Mike McLean 2007-03-29 16:48:14 -04:00
commit af521cb61a
3 changed files with 9 additions and 8 deletions

View file

@ -584,7 +584,7 @@ def handle_build(options, session, args):
callback = None
else:
callback = _progress_callback
session.uploadWrapper(source, serverdir, callback=callback)
session.uploadWrapper(source, serverdir, callback=callback, blocksize=65536)
print
source = "%s/%s" % (serverdir, os.path.basename(source))
task_id = session.build(source, target, opts, priority=priority)
@ -662,7 +662,7 @@ def handle_chain_build(options, session, args):
print os.path.basename(source)
#uploadWrapper wants the destination dir
dest = os.path.dirname(dest)
session.uploadWrapper(source, dest, callback=callback)
session.uploadWrapper(source, dest, callback=callback, blocksize=65536)
print
task_id = session.chainBuild(src_list, target, priority=priority)
@ -877,7 +877,7 @@ def handle_import(options, session, args):
else:
print _("uploading %s...") % path,
sys.stdout.flush()
session.uploadWrapper(path, serverdir)
session.uploadWrapper(path, serverdir, blocksize=65536)
print _("done")
sys.stdout.flush()
print _("importing %s...") % path,

View file

@ -116,9 +116,11 @@ class ModXMLRPCRequestHandler(object):
sys.stderr.write('\n')
response = dumps(Fault(faultCode, faultString))
sys.stderr.write("Returning %d bytes after %f seconds\n" %
(len(response),time.time() - start))
sys.stderr.flush()
if context.opts.get('KojiDebug', 'no').lower() in ('yes', 'on', 'true', '1'):
sys.stderr.write("Returning %d bytes after %f seconds\n" %
(len(response),time.time() - start))
sys.stderr.flush()
return response
def _dispatch(self,method,params):

View file

@ -1337,11 +1337,10 @@ class ClientSession(object):
# raise AttributeError, "no attribute %r" % name
return VirtualMethod(self._callMethod,name)
def uploadWrapper(self, localfile, path, name=None, callback=None):
def uploadWrapper(self, localfile, path, name=None, callback=None, blocksize=262144):
"""upload a file in chunks using the uploadFile call"""
# XXX - stick in a config or something
start=time.time()
blocksize=65536
retries=3
if name is None:
name = os.path.basename(localfile)