mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Default to Uvicorn workers=1, refs #999
This commit is contained in:
parent
2458d7b766
commit
86823ae6f7
3 changed files with 4 additions and 14 deletions
|
|
@ -465,7 +465,9 @@ def serve(
|
||||||
url = "http://{}:{}/".format(host, port)
|
url = "http://{}:{}/".format(host, port)
|
||||||
if open_browser:
|
if open_browser:
|
||||||
webbrowser.open(url)
|
webbrowser.open(url)
|
||||||
uvicorn.run(ds.app(), host=host, port=port, log_level="info", lifespan="on")
|
uvicorn.run(
|
||||||
|
ds.app(), host=host, port=port, log_level="info", lifespan="on", workers=1
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def check_databases(ds):
|
async def check_databases(ds):
|
||||||
|
|
|
||||||
|
|
@ -73,10 +73,7 @@ def publish_subcommand(publish):
|
||||||
"about_url": about_url,
|
"about_url": about_url,
|
||||||
}
|
}
|
||||||
|
|
||||||
environment_variables = {
|
environment_variables = {}
|
||||||
# Avoid uvicorn error: https://github.com/simonw/datasette/issues/633
|
|
||||||
"WEB_CONCURRENCY": "1"
|
|
||||||
}
|
|
||||||
if plugin_secret:
|
if plugin_secret:
|
||||||
extra_metadata["plugins"] = {}
|
extra_metadata["plugins"] = {}
|
||||||
for plugin_name, plugin_setting, setting_value in plugin_secret:
|
for plugin_name, plugin_setting, setting_value in plugin_secret:
|
||||||
|
|
|
||||||
|
|
@ -59,15 +59,6 @@ def test_publish_heroku(mock_call, mock_check_output, mock_which):
|
||||||
assert 0 == result.exit_code, result.output
|
assert 0 == result.exit_code, result.output
|
||||||
mock_call.assert_has_calls(
|
mock_call.assert_has_calls(
|
||||||
[
|
[
|
||||||
mock.call(
|
|
||||||
[
|
|
||||||
"heroku",
|
|
||||||
"config:set",
|
|
||||||
"-a",
|
|
||||||
"f",
|
|
||||||
"WEB_CONCURRENCY=1",
|
|
||||||
]
|
|
||||||
),
|
|
||||||
mock.call(
|
mock.call(
|
||||||
["heroku", "builds:create", "-a", "f", "--include-vcs-ignore"]
|
["heroku", "builds:create", "-a", "f", "--include-vcs-ignore"]
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue