0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00

feat(celery): Restart Celery automatically on code changes (#23279)

This commit is contained in:
Julian Bez 2024-06-27 16:02:11 +01:00 committed by GitHub
parent 3512f35cd5
commit 69927a7675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 9 deletions

View File

@ -15,13 +15,13 @@
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/env/bin/python" />
<option name="SDK_NAME" value="Python 3.11 (posthog)" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/env/bin" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/env/bin/celery" />
<option name="PARAMETERS" value="-A posthog worker --without-heartbeat --without-mingle --loglevel=DEBUG --pool=threads" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/env/bin/watchmedo" />
<option name="PARAMETERS" value="auto-restart --directory=./ --pattern=*.py --recursive -- celery -A posthog worker --without-heartbeat --without-mingle --loglevel=DEBUG --pool=threads" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -15,13 +15,13 @@
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/env/bin/python" />
<option name="SDK_NAME" value="Python 3.11 (posthog)" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/env/bin" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/env/bin/celery" />
<option name="PARAMETERS" value="-A posthog worker -B --scheduler redbeat.RedBeatScheduler --without-heartbeat --without-mingle --loglevel=DEBUG --pool=solo" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/env/bin/watchmedo" />
<option name="PARAMETERS" value="auto-restart --directory=./ --pattern=*.py --recursive -- celery -A posthog worker -B --scheduler redbeat.RedBeatScheduler --without-heartbeat --without-mingle --loglevel=DEBUG --pool=solo" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

24
.vscode/launch.json vendored
View File

@ -79,11 +79,17 @@
"include": ["posthog/**/*.py"]
},
"request": "launch",
"program": "${workspaceFolder}/env/bin/celery",
"program": "${workspaceFolder}/env/bin/watchmedo",
"console": "integratedTerminal",
"python": "${workspaceFolder}/env/bin/python",
"cwd": "${workspaceFolder}",
"args": [
"auto-restart",
"--directory=./",
"--pattern=*.py",
"--recursive",
"--",
"celery",
"-A",
"posthog",
"worker",
@ -115,11 +121,23 @@
"include": ["posthog/**/*.py"]
},
"request": "launch",
"program": "${workspaceFolder}/env/bin/celery",
"program": "${workspaceFolder}/env/bin/watchmedo",
"console": "integratedTerminal",
"python": "${workspaceFolder}/env/bin/python",
"cwd": "${workspaceFolder}",
"args": ["-A", "posthog", "beat", "-S", "redbeat.RedBeatScheduler"],
"args": [
"auto-restart",
"--directory=./",
"--pattern=*.py",
"--recursive",
"--",
"celery",
"-A",
"posthog",
"beat",
"-S",
"redbeat.RedBeatScheduler"
],
"envFile": "${workspaceFolder}/bin/celery-queues.env",
"env": {
"SKIP_ASYNC_MIGRATIONS_SETUP": "0",

View File

@ -49,6 +49,7 @@ pytest-xdist==3.6.1
python-dateutil>=2.8.2
responses==0.23.1
syrupy~=4.6.0
watchdog==2.1.8
flaky==3.7.0
aioresponses==0.7.6
prance==23.06.21.0