MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / start_server

Function start_server

scripts/affiliate_server.py:680–701  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

678
679
680def start_server():
681 sysargs = sys.argv[1:]
682 configfile, args = sysargs[0], sysargs[1:]
683 web.ol_configfile = configfile
684
685 # # type: (str) -> None
686
687 load_config(web.ol_configfile)
688 setup_requests()
689
690 # sentry loaded by infogami
691 infogami._setup()
692
693 if "pytest" not in sys.modules:
694 web.amazon_lookup_thread = make_amazon_lookup_thread()
695 thread_is_alive = bool(web.amazon_lookup_thread and web.amazon_lookup_thread.is_alive())
696 logger.critical(f"web.amazon_lookup_thread.is_alive() is {thread_is_alive}")
697 else:
698 logger.critical("Not starting amazon_lookup_thread in pytest")
699
700 sys.argv = [sys.argv[0]] + list(args)
701 app.run()
702
703
704def start_gunicorn_server():

Callers 1

Calls 4

setup_requestsFunction · 0.90
load_configFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected