mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-10 06:20:55 +08:00
made pruner a daemon thread
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
@@ -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
@@ -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
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user