Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ requests = "*"
coloredlogs = "*"
"psycopg2-binary" = "*"
gunicorn = "*"
gevent = "*"
Flask = "*"
Flask-Migrate = "*"
Flask-RESTful = "*"
Flask-Script = "*"
Flask-Session = "*"
Flask-SQLAlchemy = "*"
Flask-SSE = "*"
Flask-WTF = "*"
SQLAlchemy = "*"
Sphinx = "*"
4 changes: 3 additions & 1 deletion deploy/gunicorn.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import multiprocessing

bind = '0.0.0.0:8080'
multiprocessing.cpu_count() * 2 + 1
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = 'gevent'
worker_connections = 200
timeout = 300
accesslog = '-'
5 changes: 5 additions & 0 deletions metadash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ def setup_logger():
app.register_blueprint(metadata, url_prefix="/api")


# Register SSE
from flask_sse import sse
app.register_blueprint(sse, url_prefix='/stream')


@app.route('/', defaults={"path": ""})
@app.route('/<path>')
def index(path):
Expand Down
3 changes: 3 additions & 0 deletions metadash/build/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ module.exports = {
'/api': {
target: 'http://localhost:5000' // TODO: should be changable
},
'/stream': {
target: 'http://localhost:5000' // TODO: should be changable
},
'/docs': {
target: 'http://localhost:5000' // TODO: should be changable
}
Expand Down
2 changes: 2 additions & 0 deletions metadash/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ def initialize(settings):
}
settings.CELERY_BROKER_URL = settings.REDIS_URI
settings.CELERY_RESULT_BACKEND = settings.REDIS_URI
settings.REDIS_URL = settings.REDIS_URI
else:
settings.CACHE_DEFAULT_BACKEND = "dogpile.cache.memory"
settings.CACHE_ARGUEMENTS = {}
settings.CELERY_BROKER_URL = ''
settings.CELERY_RESULT_BACKEND = ''
settings.REDIS_URL = ''