From e8136f659ee3c0fec352c815da2054051150c39e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 11 Sep 2009 10:41:39 -0600 Subject: [PATCH] Stanza integration: Increase timeouts when sending covers/book files to one hour --- setup/installer/__init__.py | 2 +- setup/installer/osx/__init__.py | 1 + setup/installer/windows/__init__.py | 1 + src/calibre/library/server.py | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/setup/installer/__init__.py b/setup/installer/__init__.py index 3e2d10ca25..9fed8cf252 100644 --- a/setup/installer/__init__.py +++ b/setup/installer/__init__.py @@ -20,7 +20,7 @@ class VMInstaller(Command): VM_NAME = None FREEZE_COMMAND = None FREEZE_TEMPLATE = 'python setup.py {freeze_command}' - SHUTDOWN_CMD = ['sudo', 'shutdown', '-h', 'now'] + SHUTDOWN_CMD = ['sudo', 'poweroff'] IS_64_BIT = False BUILD_CMD = 'ssh -t %s bash build-calibre' diff --git a/setup/installer/osx/__init__.py b/setup/installer/osx/__init__.py index b6f5fbb045..5089859978 100644 --- a/setup/installer/osx/__init__.py +++ b/setup/installer/osx/__init__.py @@ -25,3 +25,4 @@ class OSX32(VMInstaller): VM = '/vmware/bin/%s'%VM_NAME FREEZE_COMMAND = 'osx32_freeze' BUILD_PREFIX = VMInstaller.BUILD_PREFIX + ['source ~/.profile'] + SHUTDOWN_CMD = ['sudo', 'halt'] diff --git a/setup/installer/windows/__init__.py b/setup/installer/windows/__init__.py index 1566e6099c..31973194d1 100644 --- a/setup/installer/windows/__init__.py +++ b/setup/installer/windows/__init__.py @@ -26,6 +26,7 @@ class Win32(VMInstaller): VM_NAME = 'xp_build' VM = '/vmware/bin/%s'%VM_NAME FREEZE_COMMAND = 'win32_freeze' + SHUTDOWN_CMD = ['shutdown', '-s'] def download_installer(self): installer = self.installer() diff --git a/src/calibre/library/server.py b/src/calibre/library/server.py index 058b74d4a2..8e31ff8b37 100644 --- a/src/calibre/library/server.py +++ b/src/calibre/library/server.py @@ -271,6 +271,7 @@ class LibraryServer(object): if cover is None: cover = self.default_cover cherrypy.response.headers['Content-Type'] = 'image/jpeg' + cherrypy.response.timeout = 3600 path = getattr(cover, 'name', False) updated = datetime.utcfromtimestamp(os.stat(path).st_mtime) if path and \ os.access(path, os.R_OK) else self.build_time @@ -316,6 +317,7 @@ class LibraryServer(object): if mt is None: mt = 'application/octet-stream' cherrypy.response.headers['Content-Type'] = mt + cherrypy.response.timeout = 3600 path = getattr(fmt, 'name', None) if path and os.path.exists(path): updated = datetime.utcfromtimestamp(os.stat(path).st_mtime)