From b07a01046b9db7353425fc9b9b51cdc25d21b8d6 Mon Sep 17 00:00:00 2001 From: Suejung Shin Date: Fri, 3 Jan 2025 10:31:14 -0800 Subject: [PATCH] chore: trigger commit --- dev | 35 +++++++++++++++++++++++++++++++++++ upload/serializers.py | 2 ++ 2 files changed, 37 insertions(+) create mode 100755 dev diff --git a/dev b/dev new file mode 100755 index 0000000000..be4b78ffe0 --- /dev/null +++ b/dev @@ -0,0 +1,35 @@ +#!/bin/bash + +# starts the development server using gunicorn +# NEVER run production with the --reload option command +echo "Starting gunicorn in dev mode" + +_start_gunicorn() { + if [ -n "$PROMETHEUS_MULTIPROC_DIR" ]; then + rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null + mkdir -p "$PROMETHEUS_MULTIPROC_DIR" + fi + + export PYTHONWARNINGS=always + suffix="" + if [[ "$STATSD_HOST" ]]; then + suffix="--statsd-host ${STATSD_HOST}:${STATSD_PORT}" + fi + if [ "$RUN_ENV" == "ENTERPRISE" ] || [ "$RUN_ENV" == "DEV" ]; then + python manage.py migrate + python manage.py migrate --database "timeseries" timeseries + python manage.py pgpartition --yes --skip-delete + fi + if [[ "$DEBUGPY" ]]; then + pip install debugpy + python -m debugpy --listen 0.0.0.0:12345 -m gunicorn codecov.wsgi:application --reload --bind 0.0.0.0:8000 --access-logfile '-' --timeout "${GUNICORN_TIMEOUT:-600}" $suffix + fi + gunicorn codecov.wsgi:application --reload --bind 0.0.0.0:8000 --access-logfile '-' --timeout "${GUNICORN_TIMEOUT:-600}" $suffix +} + +if [ -z "$1" ]; +then + _start_gunicorn +else + exec "$@" +fi diff --git a/upload/serializers.py b/upload/serializers.py index 63ff1c66f3..2ce16ef073 100644 --- a/upload/serializers.py +++ b/upload/serializers.py @@ -191,3 +191,5 @@ class Meta: "completed_at", ) fields = read_only_fields + +# some random comment \ No newline at end of file