made pruner a daemon thread

This commit is contained in:
Alok Saldanha
2025-11-08 18:40:33 -05:00
parent 79fef57010
commit d747860118
5 changed files with 22 additions and 5 deletions
+15
View File
@@ -115,6 +115,21 @@ docker run -it --rm \
-p 8080:8080 \ -p 8080:8080 \
cellxgene-gateway cellxgene-gateway
``` ```
## Running cellxgene gateway with start scripts
For your convenience, we provide start scripts for flask, gunicorn and uwsgi.
First, set up a .env
```bash
cp env_example .env
# edit .env
open .env
```
Then run the scripts in a subshell
```bash
( ./start_flask.sh )
```
# Customization # Customization
+4 -2
View File
@@ -378,8 +378,10 @@ def ip_address():
def start_pruner_thread(): def start_pruner_thread():
pruner = PruneProcessCache(cache) pruner = PruneProcessCache(cache)
# Run the pruner as a daemon thread so it won't block interpreter
background_thread = Thread(target=pruner) # shutdown (for example when Ctrl-C is used in the main thread).
# This avoids "Exception ignored in: <module 'threading'...>" at exit.
background_thread = Thread(target=pruner, daemon=True)
background_thread.start() background_thread.start()
+1 -1
View File
@@ -4,7 +4,7 @@
# #
# PREREQUISITES: # PREREQUISITES:
# - Gunicorn installed (included with cellxgene 1.3.0, or: pip install gunicorn) # - Gunicorn installed (included with cellxgene 1.3.0, or: pip install gunicorn)
# - Virtual environment activated or .venv present # - Virtual environment activated
# - .env file with CELLXGENE_LOCATION and CELLXGENE_DATA (or CELLXGENE_BUCKET) # - .env file with CELLXGENE_LOCATION and CELLXGENE_DATA (or CELLXGENE_BUCKET)
# #
# USAGE: # USAGE:
+1 -1
View File
@@ -4,7 +4,7 @@
# #
# PREREQUISITES: # PREREQUISITES:
# - Gunicorn installed (included with cellxgene 1.3.0, or: pip install gunicorn) # - Gunicorn installed (included with cellxgene 1.3.0, or: pip install gunicorn)
# - Virtual environment activated or .venv present # - Virtual environment activated
# - .env file with CELLXGENE_LOCATION and CELLXGENE_DATA (or CELLXGENE_BUCKET) # - .env file with CELLXGENE_LOCATION and CELLXGENE_DATA (or CELLXGENE_BUCKET)
# #
# USAGE: # USAGE:
+1 -1
View File
@@ -4,7 +4,7 @@
# #
# PREREQUISITES: # PREREQUISITES:
# - uWSGI installed (pip install uwsgi) # - uWSGI installed (pip install uwsgi)
# - Virtual environment activated or .venv present # - Virtual environment activated
# - .env file with CELLXGENE_LOCATION and CELLXGENE_DATA (or CELLXGENE_BUCKET) # - .env file with CELLXGENE_LOCATION and CELLXGENE_DATA (or CELLXGENE_BUCKET)
# #
# USAGE: # USAGE: