Commit 74b11d36 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

delete working directories only at the startup so that we can restart soffice process much faster.

parent 07e26ff2
...@@ -41,7 +41,7 @@ class Application(object): ...@@ -41,7 +41,7 @@ class Application(object):
name = "application" name = "application"
def start(self): def start(self, init=True):
"""Start Application""" """Start Application"""
logger.debug("Process Started %s, Port %s. Pid %s" % (self.name, logger.debug("Process Started %s, Port %s. Pid %s" % (self.name,
self.getAddress()[-1], self.getAddress()[-1],
...@@ -75,7 +75,7 @@ class Application(object): ...@@ -75,7 +75,7 @@ class Application(object):
def restart(self): def restart(self):
"""Start and Stop the process""" """Start and Stop the process"""
self.stop() self.stop()
self.start() self.start(init=False)
def status(self): def status(self):
"""Check by socket if the openoffice work.""" """Check by socket if the openoffice work."""
......
...@@ -130,11 +130,11 @@ class OpenOffice(Application): ...@@ -130,11 +130,11 @@ class OpenOffice(Application):
except NotImplementedError, e: except NotImplementedError, e:
logger.error("lsof isn't installed on this machine: " + str(e)) logger.error("lsof isn't installed on this machine: " + str(e))
def start(self): def start(self, init=True):
"""Start Instance.""" """Start Instance."""
self.path_user_installation = join(self.path_run_dir, \ self.path_user_installation = join(self.path_run_dir, \
"cloudooo_instance_%s" % self.port) "cloudooo_instance_%s" % self.port)
if exists(self.path_user_installation): if init and exists(self.path_user_installation):
removeDirectory(self.path_user_installation) removeDirectory(self.path_user_installation)
# Create command with all parameters to start the instance # Create command with all parameters to start the instance
self.command = [join(self.office_binary_path, self._bin_soffice), self.command = [join(self.office_binary_path, self._bin_soffice),
......
...@@ -32,7 +32,7 @@ from zope.interface import Interface ...@@ -32,7 +32,7 @@ from zope.interface import Interface
class IApplication(Interface): class IApplication(Interface):
"""Controls and monitors an application""" """Controls and monitors an application"""
def start(): def start(init=True):
"""Start the application""" """Start the application"""
def stop(): def stop():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment