def start(): try: # Run the ACME provisioning code, if it's enabled. if hs.config.acme_enabled: acme = hs.get_acme_handler() # Start up the webservices which we will respond to ACME # challenges with, and then provision. yield defer.ensureDeferred(acme.start_listening()) yield defer.ensureDeferred(do_acme()) # Check if it needs to be reprovisioned every day. hs.get_clock().looping_call(reprovision_acme, 24 * 60 * 60 * 1000) # Load the OIDC provider metadatas, if OIDC is enabled. if hs.config.oidc_enabled: oidc = hs.get_oidc_handler() # Loading the provider metadata also ensures the provider config is valid. yield defer.ensureDeferred(oidc.load_metadata()) yield defer.ensureDeferred(oidc.load_jwks()) _base.start(hs, config.listeners) hs.get_datastore().db_pool.updates.start_doing_background_updates() except Exception: # Print the exception and bail out. print("Error during startup:", file=sys.stderr) # this gives better tracebacks than traceback.print_exc() Failure().printTraceback(file=sys.stderr) if reactor.running: reactor.stop() sys.exit(1)
def start(): try: # Run the ACME provisioning code, if it's enabled. if hs.config.acme_enabled: acme = hs.get_acme_handler() # Start up the webservices which we will respond to ACME # challenges with, and then provision. yield acme.start_listening() yield do_acme() # Check if it needs to be reprovisioned every day. hs.get_clock().looping_call(reprovision_acme, 24 * 60 * 60 * 1000) _base.start(hs, config.listeners) hs.get_pusherpool().start() hs.get_datastore().start_doing_background_updates() except Exception: # Print the exception and bail out. print("Error during startup:", file=sys.stderr) # this gives better tracebacks than traceback.print_exc() Failure().printTraceback(file=sys.stderr) if reactor.running: reactor.stop() sys.exit(1)
def start(): try: # Run the ACME provisioning code, if it's enabled. if hs.config.acme_enabled: acme = hs.get_acme_handler() # Start up the webservices which we will respond to ACME # challenges with, and then provision. yield acme.start_listening() yield do_acme() # Check if it needs to be reprovisioned every day. hs.get_clock().looping_call( reprovision_acme, 24 * 60 * 60 * 1000 ) _base.start(hs, config.listeners) hs.get_pusherpool().start() hs.get_datastore().start_doing_background_updates() except Exception: # Print the exception and bail out. print("Error during startup:", file=sys.stderr) # this gives better tracebacks than traceback.print_exc() Failure().printTraceback(file=sys.stderr) if reactor.running: reactor.stop() sys.exit(1)
def start(): _base.start(ps, config.worker_listeners) ps.get_pusherpool().start()
def run(_reactor): with LoggingContext("command"): yield _base.start(ss, []) yield args.func(ss, args)
async def run(): with LoggingContext("command"): _base.start(ss, []) await args.func(ss, args)