Skip to content

Commit

Permalink
fix: Improve and refactor entrypoint to make --workers and `--threa…
Browse files Browse the repository at this point in the history
…ds` argument working (#7)

* fix: Improve and refacor entrypoint to make `--workers` and `--threads` argument working

* The app_server took the entrpoint from _app.yaml_, which has mostly set
  this property. So the default value of `appYaml.get("entrypoint")` was
  actually never used. But the entrypoint in _app.yaml_ cannot have a
  `$WORKER` or `$THREADS` variable -- they don't exist in gcloud
  (https://cloud.google.com/appengine/docs/standard/python3/runtime#environment_variables)
  So the variables were never replaced, because they dont't exist.
  That made the `--worker` and `--thread` argument of the app_server
  useless.
* Now we remove these argument always from the provides entrypoint and
  re-add it with the values from our argparse. This get the arguemnts
  working.
* Furthermore I added an option to provide an custom entrypoint, if the
  entrypoint is set in the _app.yaml_, but should be different for the
  local server. Setting this through the subprocess-call in the viur-cli
  is a little bit tricky, but with double quoting it works.
* I (and PyCharm ^^) refactored this code a bit and add some type hints.

* refactor: Do some more refactorings

* refactor: Do some more refactorings
  • Loading branch information
sveneberth authored May 6, 2024
1 parent 604a1d8 commit 072ea6f
Showing 1 changed file with 159 additions and 94 deletions.
Loading

0 comments on commit 072ea6f

Please sign in to comment.