Unleash / Unleash/unleash-python-sdk

Client not getting updated toggles in flask app when running via gunicorn with "--preload" option

Open
#216 4 comments 2 reactions 1 assignee View on GitHub

@sighphyre is already working on this.

Since Jul 22, 2022.

later pinned
Dominant language
Python
Stars
92
Forks
69
Avg merge
3h 39m
Merged PRs (30d)
1

Description

Describe the bug

When running unleash with flask/gunicorn, it is not getting updated with latest toggles from unleash server when it is run with option "--preload". More info on preload

gunicorn --chdir app app:app -w 2 --threads 2 -b 0.0.0.0:80 --preload

To Reproduce

I have a branch to demonstrate. using this demo toggle https://app.unleash-hosted.com/demo/projects/default/features/gunicorn

  1. From this Repo https://github.com/raymzag/Flask_Docker_App
  2. docker-compose up --build
  3. Go to http://localhost/test_unleash
  4. Try toggling on/off, give it some time 10-15s. It will not be updated.
  5. Remove the --preload option from https://github.com/raymzag/Flask_Docker_App/blob/master/gunicorn.sh
  6. Do docker-compose up --build again.
  7. Try toggling on/off, give it some time 10-15s. it will be updated.

Expected behavior
Expects the unleash toggles to be refreshed in flask/gunicorn app with --preload option.

Logs
If applicable, add logs or output to help explain your problem.

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.