Repository navigation
Read WORKERS in the systemd REST unit - #234
Closed
tomahawkeer wants to merge 1 commit into
Closed
tomahawkeer wants to merge 1 commit into
tomahawkeer wants to merge 1 commit into
Conversation
relaysms-publisher-rest.service hard-coded --workers 4, while
scripts/run.sh and the Docker entrypoint read WORKERS from the
environment, so setting WORKERS in .env had no effect on server installs.
systemd's ExecStart= supports ${VAR} but not shell-style ${VAR:-4}, so
the unit sets Environment=WORKERS=4 as the default and passes
--workers "${WORKERS}". EnvironmentFile= overrides Environment=, so a
WORKERS line in .env takes precedence.
Adds a render_units test and notes in the settings reference that all
three launchers read WORKERS from .env.
Fixes smswithoutborders#221
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FiGQujBCL8qnuH6bAv3Yiz
|
Thanks for the PR. It doesn't follow the contribution guide yet:
Also run the checks CI runs before you push. This comment updates when you push or edit the PR. Without activity, the PR is closed after 5 days. |
Contributor
Author
|
Superseded by a new PR against |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #221
relaysms-publisher-rest.servicehard-coded--workers 4, whilescripts/run.shand the Docker entrypoint readWORKERS, so setting it in.envhad no effect on server installs.Changes
Environment=WORKERS=4as the default and passes--workers "${WORKERS}".--workers "${WORKERS:-4}", butExecStart=only supports${VAR}/$VARsubstitution, not shell-style defaults (systemd.service). SinceEnvironmentFile=overridesEnvironment=(systemd.exec), aWORKERSline in.envstill takes precedence.tests/scripts/test_lib.py:test_rest_unit_reads_workers_with_a_defaultchecks the rendered unit.docs/configuration/settings.md: theWORKERSrow notes that all three launchers read it from.env.Testing
pytest tests/test_config.py tests/scripts/test_lib.py: 62 passed. The new test fails against the old unit.systemd-analyze verifyaccepts the rendered unit.ruff check/ruff format --checkpass.lib_relaysms_payload_specs.generatedmodule (not touched by this change). Not started under a live systemd.WORKERS=line left empty in.envwould override the default with an empty value, the same asHOST/PORTtoday.template.envships it commented out, so the default applies.🤖 Generated with Claude Code
https://claude.ai/code/session_01FiGQujBCL8qnuH6bAv3Yiz