comparison libervia/server/server.py @ 1368:9624c2a89a92

server: new `--build-only` flag: when this flag is set, the HTTP server is not launched, and Libervia quits immediately after running building tasks.
author Goffi <goffi@goffi.org>
date Fri, 20 Nov 2020 18:04:05 +0100
parents ce5cfe004d4e
children b5f2565c4bac
comparison
equal deleted inserted replaced
1367:ce5cfe004d4e 1368:9624c2a89a92
1569 log.error(_("Init error: {msg}").format(msg=failure)) 1569 log.error(_("Init error: {msg}").format(msg=failure))
1570 app._exitCode = C.EXIT_INTERNAL_ERROR 1570 app._exitCode = C.EXIT_INTERNAL_ERROR
1571 reactor.stop() 1571 reactor.stop()
1572 return failure 1572 return failure
1573 1573
1574 def _buildOnlyCb(self, __):
1575 log.info(_("Stopping here due to --build-only flag"))
1576 self.stop()
1577
1574 def startService(self): 1578 def startService(self):
1575 """Connect the profile for Libervia and start the HTTP(S) server(s)""" 1579 """Connect the profile for Libervia and start the HTTP(S) server(s)"""
1576 self._init() 1580 self._init()
1577 self.initialised.addCallback(self._startService) 1581 if self.options['build-only']:
1582 self.initialised.addCallback(self._buildOnlyCb)
1583 else:
1584 self.initialised.addCallback(self._startService)
1578 self.initialised.addErrback(self.initEb) 1585 self.initialised.addErrback(self.initEb)
1579 1586
1580 ## URLs ## 1587 ## URLs ##
1581 1588
1582 def putChildSAT(self, path, resource): 1589 def putChildSAT(self, path, resource):