We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
app entrypoint no longer supports --max-requests-jitter
**Version**
3.39

**Describe the bug**
--max-requests-jitter is not recognized

**To Reproduce**
Run the pulpcore-api entrypoint with --max-requests-jitter

**Expected behavior**
Accepts the argument

**Additional context**
Requested for Katello.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pulpcore/app/entrypoint.py`
Content:
```
1 from contextvars import ContextVar
2 from logging import getLogger
3 import os
4 import socket
5 
6 import click
7 import django
8 from django.conf import settings
9 from django.db import connection
10 from django.db.utils import InterfaceError, OperationalError
11 from gunicorn.workers.sync import SyncWorker
12 from gunicorn.app.base import BaseApplication
13 
14 from pulpcore.app.apps import pulp_plugin_configs
15 
16 logger = getLogger(__name__)
17 
18 
19 using_pulp_api_worker = ContextVar("using_pulp_api_worker", default=False)
20 
21 
22 class PulpApiWorker(SyncWorker):
23     def notify(self):
24         super().notify()
25         self.heartbeat()
26 
27     def heartbeat(self):
28         try:
29             self.api_app_status, created = self.ApiAppStatus.objects.get_or_create(
30                 name=self.name, defaults={"versions": self.versions}
31             )
32 
33             if not created:
34                 self.api_app_status.save_heartbeat()
35 
36                 if self.api_app_status.versions != self.versions:
37                     self.api_app_status.versions = self.versions
38                     self.api_app_status.save(update_fields=["versions"])
39 
40             logger.debug(self.beat_msg)
41         except (InterfaceError, OperationalError):
42             connection.close_if_unusable_or_obsolete()
43             logger.info(self.fail_beat_msg)
44 
45     def init_process(self):
46         os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pulpcore.app.settings")
47         django.setup()
48         from pulpcore.app.models import ApiAppStatus
49 
50         if settings.API_APP_TTL < 2 * self.timeout:
51             logger.warn(
52                 "API_APP_TTL (%s) is smaller than half the gunicorn timeout (%s). "
53                 "You may experience workers wrongly reporting as missing",
54                 settings.API_APP_TTL,
55                 self.timeout,
56             )
57 
58         self.ApiAppStatus = ApiAppStatus
59         self.api_app_status = None
60 
61         self.name = "{pid}@{hostname}".format(pid=self.pid, hostname=socket.gethostname())
62         self.versions = {app.label: app.version for app in pulp_plugin_configs()}
63         self.beat_msg = (
64             "Api App '{name}' heartbeat written, sleeping for '{interarrival}' seconds".format(
65                 name=self.name, interarrival=self.timeout
66             )
67         )
68         self.fail_beat_msg = (
69             "Api App '{name}' failed to write a heartbeat to the database, sleeping for "
70             "'{interarrival}' seconds."
71         ).format(name=self.name, interarrival=self.timeout)
72         super().init_process()
73 
74     def run(self):
75         try:
76             super().run()
77         finally:
78             # cleanup
79             if self.api_app_status:
80                 self.api_app_status.delete()
81 
82 
83 class PulpcoreApiApplication(BaseApplication):
84     def __init__(self, options):
85         self.options = options or {}
86         super().__init__()
87 
88     def load_config(self):
89         [
90             self.cfg.set(key.lower(), value)
91             for key, value in self.options.items()
92             if value is not None
93         ]
94         self.cfg.set("default_proc_name", "pulpcore-api")
95         self.cfg.set("worker_class", PulpApiWorker.__module__ + "." + PulpApiWorker.__qualname__)
96 
97     def load(self):
98         using_pulp_api_worker.set(True)
99 
100         import pulpcore.app.wsgi
101 
102         using_pulp_api_worker.set(False)
103         return pulpcore.app.wsgi.application
104 
105 
106 # Gunicorn options are adapted from:
107 # https://github.com/benoitc/gunicorn/blob/master/gunicorn/config.py
108 
109 
110 @click.option("--bind", "-b", default="[::]:24817")
111 @click.option("--workers", "-w", type=int)
112 # @click.option("--threads", "-w", type=int)  # We don't use a threaded worker...
113 @click.option("--name", "-n", "proc_name")
114 @click.option("--timeout", "-t", type=int)
115 @click.option("--graceful-timeout", type=int)
116 @click.option("--keep-alive", "keepalive", type=int)
117 @click.option("--limit-request-line", type=int)
118 @click.option("--limit-request-fields", type=int)
119 @click.option("--limit-request-field-size", type=int)
120 @click.option("--max-requests", type=int)
121 @click.option("--access-logfile", "accesslog")
122 @click.option(
123     "--access-logformat",
124     "access_log_format",
125     default=(
126         "pulp [%({correlation-id}o)s]: "
127         '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"',
128     ),
129 )
130 @click.option("--error-logfile", "--log-file", "errorlog")
131 @click.option(
132     "--log-level", "loglevel", type=click.Choice(["debug", "info", "warning", "error", "critical"])
133 )
134 @click.option("--reload/--no-reload")
135 @click.option("--reload-engine", type=click.Choice(["auto", "poll", "inotify"]))
136 @click.option("--reload-extra-file", "reload_extra_files", multiple=True)
137 @click.option("--preload/--no-preload", "preload_app")
138 @click.option("--reuse-port/--no-reuse-port")
139 @click.option("--chdir")
140 @click.option("--user", "-u")
141 @click.option("--group", "-g")
142 @click.command()
143 def main(**options):
144     PulpcoreApiApplication(options).run()
145
```

Path: `pulpcore/content/entrypoint.py`
Content:
```
1 import click
2 from gunicorn.app.base import BaseApplication
3 
4 
5 class PulpcoreContentApplication(BaseApplication):
6     def __init__(self, options):
7         self.options = options or {}
8         super().__init__()
9 
10     def load_config(self):
11         [
12             self.cfg.set(key.lower(), value)
13             for key, value in self.options.items()
14             if value is not None
15         ]
16         self.cfg.set("default_proc_name", "pulpcore-content")
17         self.cfg.set("worker_class", "aiohttp.GunicornWebWorker")
18 
19     def load(self):
20         import pulpcore.content
21 
22         return pulpcore.content.server
23 
24 
25 @click.option("--bind", "-b", default="[::]:24816")
26 @click.option("--workers", "-w", type=int)
27 # @click.option("--threads", "-w", type=int)  # We don't use a threaded worker...
28 @click.option("--name", "-n", "proc_name")
29 @click.option("--timeout", "-t", type=int)
30 @click.option("--graceful-timeout", type=int)
31 @click.option("--keep-alive", "keepalive", type=int)
32 @click.option("--limit-request-line", type=int)
33 @click.option("--limit-request-fields", type=int)
34 @click.option("--limit-request-field-size", type=int)
35 @click.option("--max-requests", type=int)
36 @click.option("--access-logfile", "accesslog")
37 @click.option("--access-logformat", "access_log_format")
38 @click.option("--error-logfile", "--log-file", "errorlog")
39 @click.option(
40     "--log-level", "loglevel", type=click.Choice(["debug", "info", "warning", "error", "critical"])
41 )
42 @click.option("--reload/--no-reload")
43 @click.option("--reload-engine", type=click.Choice(["auto", "poll", "inotify"]))
44 @click.option("--reload-extra-file", "reload_extra_files", multiple=True)
45 @click.option("--preload/--no-preload", "preload_app")
46 @click.option("--reuse-port/--no-reuse-port")
47 @click.option("--chdir")
48 @click.option("--user", "-u")
49 @click.option("--group", "-g")
50 @click.command()
51 def main(**options):
52     PulpcoreContentApplication(options).run()
53
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pulpcore/app/entrypoint.py b/pulpcore/app/entrypoint.py
--- a/pulpcore/app/entrypoint.py
+++ b/pulpcore/app/entrypoint.py
@@ -118,6 +118,7 @@
 @click.option("--limit-request-fields", type=int)
 @click.option("--limit-request-field-size", type=int)
 @click.option("--max-requests", type=int)
+@click.option("--max-requests-jitter", type=int)
 @click.option("--access-logfile", "accesslog")
 @click.option(
     "--access-logformat",
diff --git a/pulpcore/content/entrypoint.py b/pulpcore/content/entrypoint.py
--- a/pulpcore/content/entrypoint.py
+++ b/pulpcore/content/entrypoint.py
@@ -33,6 +33,7 @@
 @click.option("--limit-request-fields", type=int)
 @click.option("--limit-request-field-size", type=int)
 @click.option("--max-requests", type=int)
+@click.option("--max-requests-jitter", type=int)
 @click.option("--access-logfile", "accesslog")
 @click.option("--access-logformat", "access_log_format")
 @click.option("--error-logfile", "--log-file", "errorlog")

{"golden_diff": "diff --git a/pulpcore/app/entrypoint.py b/pulpcore/app/entrypoint.py\n--- a/pulpcore/app/entrypoint.py\n+++ b/pulpcore/app/entrypoint.py\n@@ -118,6 +118,7 @@\n @click.option(\"--limit-request-fields\", type=int)\n @click.option(\"--limit-request-field-size\", type=int)\n @click.option(\"--max-requests\", type=int)\n+@click.option(\"--max-requests-jitter\", type=int)\n @click.option(\"--access-logfile\", \"accesslog\")\n @click.option(\n     \"--access-logformat\",\ndiff --git a/pulpcore/content/entrypoint.py b/pulpcore/content/entrypoint.py\n--- a/pulpcore/content/entrypoint.py\n+++ b/pulpcore/content/entrypoint.py\n@@ -33,6 +33,7 @@\n @click.option(\"--limit-request-fields\", type=int)\n @click.option(\"--limit-request-field-size\", type=int)\n @click.option(\"--max-requests\", type=int)\n+@click.option(\"--max-requests-jitter\", type=int)\n @click.option(\"--access-logfile\", \"accesslog\")\n @click.option(\"--access-logformat\", \"access_log_format\")\n @click.option(\"--error-logfile\", \"--log-file\", \"errorlog\")\n", "issue": "app entrypoint no longer supports --max-requests-jitter\n**Version**\r\n3.39\r\n\r\n**Describe the bug**\r\n--max-requests-jitter is not recognized\r\n\r\n**To Reproduce**\r\nRun the pulpcore-api entrypoint with --max-requests-jitter\r\n\r\n**Expected behavior**\r\nAccepts the argument\r\n\r\n**Additional context**\r\nRequested for Katello.\r\n\n", "before_files": [{"content": "from contextvars import ContextVar\nfrom logging import getLogger\nimport os\nimport socket\n\nimport click\nimport django\nfrom django.conf import settings\nfrom django.db import connection\nfrom django.db.utils import InterfaceError, OperationalError\nfrom gunicorn.workers.sync import SyncWorker\nfrom gunicorn.app.base import BaseApplication\n\nfrom pulpcore.app.apps import pulp_plugin_configs\n\nlogger = getLogger(__name__)\n\n\nusing_pulp_api_worker = ContextVar(\"using_pulp_api_worker\", default=False)\n\n\nclass PulpApiWorker(SyncWorker):\n    def notify(self):\n        super().notify()\n        self.heartbeat()\n\n    def heartbeat(self):\n        try:\n            self.api_app_status, created = self.ApiAppStatus.objects.get_or_create(\n                name=self.name, defaults={\"versions\": self.versions}\n            )\n\n            if not created:\n                self.api_app_status.save_heartbeat()\n\n                if self.api_app_status.versions != self.versions:\n                    self.api_app_status.versions = self.versions\n                    self.api_app_status.save(update_fields=[\"versions\"])\n\n            logger.debug(self.beat_msg)\n        except (InterfaceError, OperationalError):\n            connection.close_if_unusable_or_obsolete()\n            logger.info(self.fail_beat_msg)\n\n    def init_process(self):\n        os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"pulpcore.app.settings\")\n        django.setup()\n        from pulpcore.app.models import ApiAppStatus\n\n        if settings.API_APP_TTL < 2 * self.timeout:\n            logger.warn(\n                \"API_APP_TTL (%s) is smaller than half the gunicorn timeout (%s). \"\n                \"You may experience workers wrongly reporting as missing\",\n                settings.API_APP_TTL,\n                self.timeout,\n            )\n\n        self.ApiAppStatus = ApiAppStatus\n        self.api_app_status = None\n\n        self.name = \"{pid}@{hostname}\".format(pid=self.pid, hostname=socket.gethostname())\n        self.versions = {app.label: app.version for app in pulp_plugin_configs()}\n        self.beat_msg = (\n            \"Api App '{name}' heartbeat written, sleeping for '{interarrival}' seconds\".format(\n                name=self.name, interarrival=self.timeout\n            )\n        )\n        self.fail_beat_msg = (\n            \"Api App '{name}' failed to write a heartbeat to the database, sleeping for \"\n            \"'{interarrival}' seconds.\"\n        ).format(name=self.name, interarrival=self.timeout)\n        super().init_process()\n\n    def run(self):\n        try:\n            super().run()\n        finally:\n            # cleanup\n            if self.api_app_status:\n                self.api_app_status.delete()\n\n\nclass PulpcoreApiApplication(BaseApplication):\n    def __init__(self, options):\n        self.options = options or {}\n        super().__init__()\n\n    def load_config(self):\n        [\n            self.cfg.set(key.lower(), value)\n            for key, value in self.options.items()\n            if value is not None\n        ]\n        self.cfg.set(\"default_proc_name\", \"pulpcore-api\")\n        self.cfg.set(\"worker_class\", PulpApiWorker.__module__ + \".\" + PulpApiWorker.__qualname__)\n\n    def load(self):\n        using_pulp_api_worker.set(True)\n\n        import pulpcore.app.wsgi\n\n        using_pulp_api_worker.set(False)\n        return pulpcore.app.wsgi.application\n\n\n# Gunicorn options are adapted from:\n# https://github.com/benoitc/gunicorn/blob/master/gunicorn/config.py\n\n\n@click.option(\"--bind\", \"-b\", default=\"[::]:24817\")\n@click.option(\"--workers\", \"-w\", type=int)\n# @click.option(\"--threads\", \"-w\", type=int)  # We don't use a threaded worker...\n@click.option(\"--name\", \"-n\", \"proc_name\")\n@click.option(\"--timeout\", \"-t\", type=int)\n@click.option(\"--graceful-timeout\", type=int)\n@click.option(\"--keep-alive\", \"keepalive\", type=int)\n@click.option(\"--limit-request-line\", type=int)\n@click.option(\"--limit-request-fields\", type=int)\n@click.option(\"--limit-request-field-size\", type=int)\n@click.option(\"--max-requests\", type=int)\n@click.option(\"--access-logfile\", \"accesslog\")\n@click.option(\n    \"--access-logformat\",\n    \"access_log_format\",\n    default=(\n        \"pulp [%({correlation-id}o)s]: \"\n        '%(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\"',\n    ),\n)\n@click.option(\"--error-logfile\", \"--log-file\", \"errorlog\")\n@click.option(\n    \"--log-level\", \"loglevel\", type=click.Choice([\"debug\", \"info\", \"warning\", \"error\", \"critical\"])\n)\n@click.option(\"--reload/--no-reload\")\n@click.option(\"--reload-engine\", type=click.Choice([\"auto\", \"poll\", \"inotify\"]))\n@click.option(\"--reload-extra-file\", \"reload_extra_files\", multiple=True)\n@click.option(\"--preload/--no-preload\", \"preload_app\")\n@click.option(\"--reuse-port/--no-reuse-port\")\n@click.option(\"--chdir\")\n@click.option(\"--user\", \"-u\")\n@click.option(\"--group\", \"-g\")\n@click.command()\ndef main(**options):\n    PulpcoreApiApplication(options).run()\n", "path": "pulpcore/app/entrypoint.py"}, {"content": "import click\nfrom gunicorn.app.base import BaseApplication\n\n\nclass PulpcoreContentApplication(BaseApplication):\n    def __init__(self, options):\n        self.options = options or {}\n        super().__init__()\n\n    def load_config(self):\n        [\n            self.cfg.set(key.lower(), value)\n            for key, value in self.options.items()\n            if value is not None\n        ]\n        self.cfg.set(\"default_proc_name\", \"pulpcore-content\")\n        self.cfg.set(\"worker_class\", \"aiohttp.GunicornWebWorker\")\n\n    def load(self):\n        import pulpcore.content\n\n        return pulpcore.content.server\n\n\n@click.option(\"--bind\", \"-b\", default=\"[::]:24816\")\n@click.option(\"--workers\", \"-w\", type=int)\n# @click.option(\"--threads\", \"-w\", type=int)  # We don't use a threaded worker...\n@click.option(\"--name\", \"-n\", \"proc_name\")\n@click.option(\"--timeout\", \"-t\", type=int)\n@click.option(\"--graceful-timeout\", type=int)\n@click.option(\"--keep-alive\", \"keepalive\", type=int)\n@click.option(\"--limit-request-line\", type=int)\n@click.option(\"--limit-request-fields\", type=int)\n@click.option(\"--limit-request-field-size\", type=int)\n@click.option(\"--max-requests\", type=int)\n@click.option(\"--access-logfile\", \"accesslog\")\n@click.option(\"--access-logformat\", \"access_log_format\")\n@click.option(\"--error-logfile\", \"--log-file\", \"errorlog\")\n@click.option(\n    \"--log-level\", \"loglevel\", type=click.Choice([\"debug\", \"info\", \"warning\", \"error\", \"critical\"])\n)\n@click.option(\"--reload/--no-reload\")\n@click.option(\"--reload-engine\", type=click.Choice([\"auto\", \"poll\", \"inotify\"]))\n@click.option(\"--reload-extra-file\", \"reload_extra_files\", multiple=True)\n@click.option(\"--preload/--no-preload\", \"preload_app\")\n@click.option(\"--reuse-port/--no-reuse-port\")\n@click.option(\"--chdir\")\n@click.option(\"--user\", \"-u\")\n@click.option(\"--group\", \"-g\")\n@click.command()\ndef main(**options):\n    PulpcoreContentApplication(options).run()\n", "path": "pulpcore/content/entrypoint.py"}], "after_files": [{"content": "from contextvars import ContextVar\nfrom logging import getLogger\nimport os\nimport socket\n\nimport click\nimport django\nfrom django.conf import settings\nfrom django.db import connection\nfrom django.db.utils import InterfaceError, OperationalError\nfrom gunicorn.workers.sync import SyncWorker\nfrom gunicorn.app.base import BaseApplication\n\nfrom pulpcore.app.apps import pulp_plugin_configs\n\nlogger = getLogger(__name__)\n\n\nusing_pulp_api_worker = ContextVar(\"using_pulp_api_worker\", default=False)\n\n\nclass PulpApiWorker(SyncWorker):\n    def notify(self):\n        super().notify()\n        self.heartbeat()\n\n    def heartbeat(self):\n        try:\n            self.api_app_status, created = self.ApiAppStatus.objects.get_or_create(\n                name=self.name, defaults={\"versions\": self.versions}\n            )\n\n            if not created:\n                self.api_app_status.save_heartbeat()\n\n                if self.api_app_status.versions != self.versions:\n                    self.api_app_status.versions = self.versions\n                    self.api_app_status.save(update_fields=[\"versions\"])\n\n            logger.debug(self.beat_msg)\n        except (InterfaceError, OperationalError):\n            connection.close_if_unusable_or_obsolete()\n            logger.info(self.fail_beat_msg)\n\n    def init_process(self):\n        os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"pulpcore.app.settings\")\n        django.setup()\n        from pulpcore.app.models import ApiAppStatus\n\n        if settings.API_APP_TTL < 2 * self.timeout:\n            logger.warn(\n                \"API_APP_TTL (%s) is smaller than half the gunicorn timeout (%s). \"\n                \"You may experience workers wrongly reporting as missing\",\n                settings.API_APP_TTL,\n                self.timeout,\n            )\n\n        self.ApiAppStatus = ApiAppStatus\n        self.api_app_status = None\n\n        self.name = \"{pid}@{hostname}\".format(pid=self.pid, hostname=socket.gethostname())\n        self.versions = {app.label: app.version for app in pulp_plugin_configs()}\n        self.beat_msg = (\n            \"Api App '{name}' heartbeat written, sleeping for '{interarrival}' seconds\".format(\n                name=self.name, interarrival=self.timeout\n            )\n        )\n        self.fail_beat_msg = (\n            \"Api App '{name}' failed to write a heartbeat to the database, sleeping for \"\n            \"'{interarrival}' seconds.\"\n        ).format(name=self.name, interarrival=self.timeout)\n        super().init_process()\n\n    def run(self):\n        try:\n            super().run()\n        finally:\n            # cleanup\n            if self.api_app_status:\n                self.api_app_status.delete()\n\n\nclass PulpcoreApiApplication(BaseApplication):\n    def __init__(self, options):\n        self.options = options or {}\n        super().__init__()\n\n    def load_config(self):\n        [\n            self.cfg.set(key.lower(), value)\n            for key, value in self.options.items()\n            if value is not None\n        ]\n        self.cfg.set(\"default_proc_name\", \"pulpcore-api\")\n        self.cfg.set(\"worker_class\", PulpApiWorker.__module__ + \".\" + PulpApiWorker.__qualname__)\n\n    def load(self):\n        using_pulp_api_worker.set(True)\n\n        import pulpcore.app.wsgi\n\n        using_pulp_api_worker.set(False)\n        return pulpcore.app.wsgi.application\n\n\n# Gunicorn options are adapted from:\n# https://github.com/benoitc/gunicorn/blob/master/gunicorn/config.py\n\n\n@click.option(\"--bind\", \"-b\", default=\"[::]:24817\")\n@click.option(\"--workers\", \"-w\", type=int)\n# @click.option(\"--threads\", \"-w\", type=int)  # We don't use a threaded worker...\n@click.option(\"--name\", \"-n\", \"proc_name\")\n@click.option(\"--timeout\", \"-t\", type=int)\n@click.option(\"--graceful-timeout\", type=int)\n@click.option(\"--keep-alive\", \"keepalive\", type=int)\n@click.option(\"--limit-request-line\", type=int)\n@click.option(\"--limit-request-fields\", type=int)\n@click.option(\"--limit-request-field-size\", type=int)\n@click.option(\"--max-requests\", type=int)\n@click.option(\"--max-requests-jitter\", type=int)\n@click.option(\"--access-logfile\", \"accesslog\")\n@click.option(\n    \"--access-logformat\",\n    \"access_log_format\",\n    default=(\n        \"pulp [%({correlation-id}o)s]: \"\n        '%(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\"',\n    ),\n)\n@click.option(\"--error-logfile\", \"--log-file\", \"errorlog\")\n@click.option(\n    \"--log-level\", \"loglevel\", type=click.Choice([\"debug\", \"info\", \"warning\", \"error\", \"critical\"])\n)\n@click.option(\"--reload/--no-reload\")\n@click.option(\"--reload-engine\", type=click.Choice([\"auto\", \"poll\", \"inotify\"]))\n@click.option(\"--reload-extra-file\", \"reload_extra_files\", multiple=True)\n@click.option(\"--preload/--no-preload\", \"preload_app\")\n@click.option(\"--reuse-port/--no-reuse-port\")\n@click.option(\"--chdir\")\n@click.option(\"--user\", \"-u\")\n@click.option(\"--group\", \"-g\")\n@click.command()\ndef main(**options):\n    PulpcoreApiApplication(options).run()\n", "path": "pulpcore/app/entrypoint.py"}, {"content": "import click\nfrom gunicorn.app.base import BaseApplication\n\n\nclass PulpcoreContentApplication(BaseApplication):\n    def __init__(self, options):\n        self.options = options or {}\n        super().__init__()\n\n    def load_config(self):\n        [\n            self.cfg.set(key.lower(), value)\n            for key, value in self.options.items()\n            if value is not None\n        ]\n        self.cfg.set(\"default_proc_name\", \"pulpcore-content\")\n        self.cfg.set(\"worker_class\", \"aiohttp.GunicornWebWorker\")\n\n    def load(self):\n        import pulpcore.content\n\n        return pulpcore.content.server\n\n\n@click.option(\"--bind\", \"-b\", default=\"[::]:24816\")\n@click.option(\"--workers\", \"-w\", type=int)\n# @click.option(\"--threads\", \"-w\", type=int)  # We don't use a threaded worker...\n@click.option(\"--name\", \"-n\", \"proc_name\")\n@click.option(\"--timeout\", \"-t\", type=int)\n@click.option(\"--graceful-timeout\", type=int)\n@click.option(\"--keep-alive\", \"keepalive\", type=int)\n@click.option(\"--limit-request-line\", type=int)\n@click.option(\"--limit-request-fields\", type=int)\n@click.option(\"--limit-request-field-size\", type=int)\n@click.option(\"--max-requests\", type=int)\n@click.option(\"--max-requests-jitter\", type=int)\n@click.option(\"--access-logfile\", \"accesslog\")\n@click.option(\"--access-logformat\", \"access_log_format\")\n@click.option(\"--error-logfile\", \"--log-file\", \"errorlog\")\n@click.option(\n    \"--log-level\", \"loglevel\", type=click.Choice([\"debug\", \"info\", \"warning\", \"error\", \"critical\"])\n)\n@click.option(\"--reload/--no-reload\")\n@click.option(\"--reload-engine\", type=click.Choice([\"auto\", \"poll\", \"inotify\"]))\n@click.option(\"--reload-extra-file\", \"reload_extra_files\", multiple=True)\n@click.option(\"--preload/--no-preload\", \"preload_app\")\n@click.option(\"--reuse-port/--no-reuse-port\")\n@click.option(\"--chdir\")\n@click.option(\"--user\", \"-u\")\n@click.option(\"--group\", \"-g\")\n@click.command()\ndef main(**options):\n    PulpcoreContentApplication(options).run()\n", "path": "pulpcore/content/entrypoint.py"}]}