这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .upsun/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ applications:

web:
commands:
start: ".venv/bin/gunicorn main:app"
start: ".venv/bin/blackfire-python .venv/bin/gunicorn main:app"
upstream:
socket_family: tcp
locations:
Expand Down
10 changes: 10 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ def create_app():
CORS(app)

if __name__ == "__main__":
try:
from blackfire_conprof.profiler import Profiler

# application_name will be auto-populated via PLATFORM_APPLICATION_NAME/BLACKFIRE_CONPROF_APP_NAME
# profiler.stop() will be called on app exit by default
profiler = Profiler()
profiler.start()
except Exception as err:
print(err)

flask_environment = os.environ.get("FLASK_ENV", "local")
enable_debug = flask_environment != "production"
web_port = os.environ.get("PORT", 8000)
Expand Down
2 changes: 2 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ requires-python = ">=3.12"
dependencies = [
"async-timeout==4.0.3",
"black==24.4.0",
"blackfire>=1.20.33",
"blackfire_conprof>=1.2.5",
"blinker==1.7.0",
"boolean-py==4.0",
"cachecontrol==0.13.1",
Expand Down
2 changes: 1 addition & 1 deletion backend/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

uv run gunicorn main:app
uv run blackfire-python gunicorn main:app
20 changes: 20 additions & 0 deletions backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading