lib/taskjuggler/apps/Tj3Daemon.rb in taskjuggler-0.0.11 vs lib/taskjuggler/apps/Tj3Daemon.rb in taskjuggler-0.1.0

- old
+ new

@@ -70,30 +70,33 @@ @webServerPort = arg end end end - def main(argv = ARGV) - files = super - broker = ProjectBroker.new - @rc.configure(self, 'global') - @rc.configure(@log, 'global.log') - @rc.configure(broker, 'global') - @rc.configure(broker, 'daemon') + def appMain(files) + begin + broker = ProjectBroker.new + @rc.configure(self, 'global') + @rc.configure(@log, 'global.log') + @rc.configure(broker, 'global') + @rc.configure(broker, 'daemon') - # Set some config variables if corresponding data was provided via the - # command line. - broker.port = @port if @port - broker.uriFile = @uriFile.untaint - broker.enableWebServer = @webServer - broker.webServerPort = @webServerPort if @webServerPort - broker.projectFiles = sortInputFiles(files) unless files.empty? - broker.daemonize = @daemonize - # Create log files for standard IO for each child process if the daemon - # is not disconnected from the terminal. - broker.logStdIO = !@daemonize + # Set some config variables if corresponding data was provided via the + # command line. + broker.port = @port if @port + broker.uriFile = @uriFile.untaint + broker.enableWebServer = @webServer + broker.webServerPort = @webServerPort if @webServerPort + broker.projectFiles = sortInputFiles(files) unless files.empty? + broker.daemonize = @daemonize + # Create log files for standard IO for each child process if the daemon + # is not disconnected from the terminal. + broker.logStdIO = !@daemonize - broker.start + return broker.start + rescue TjRuntimeError + return 1 + end end private # Sort the provided input files into groups of projects. Each *.tjp file