Skip to content

Commit

Permalink
adding gevent and eventlet for socketio
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienParis committed Jan 31, 2019
1 parent 183be25 commit 61308e1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 19 deletions.
6 changes: 6 additions & 0 deletions appserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
from log_config import log, pformat
# log.debug('>>> TESTING LOGGER')

### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
### FLASK-SOCKETIO
### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
from flask_socketio import SocketIO

### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
### RUN APPSERVER
Expand Down Expand Up @@ -79,6 +83,8 @@ def app_runner(mode, host, port) :

app_debug = app.config["DEBUG"]

### initiate socketio
socketio = SocketIO(app)

# simple flask runner
print()
Expand Down
16 changes: 0 additions & 16 deletions package-lock.json

This file was deleted.

5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ cloudpickle==0.6.1
colorlog==4.0.2
dask==1.1.0
distributed==1.25.2
dnspython==1.16.0
eventlet==0.24.1
Flask==1.0.2
Flask-Cors==3.0.7
Flask-JWT-Extended==3.15.0
Expand All @@ -16,6 +18,8 @@ flask-restplus==0.12.1
Flask-SocketIO==3.2.1
geographiclib==1.49
geopy==1.18.1
gevent==1.4.0
greenlet==0.4.15
gunicorn==19.9.0
HeapDict==1.0.0
idna==2.8
Expand All @@ -25,6 +29,7 @@ jsonschema==2.6.0
llvmlite==0.27.0
locket==0.2.0
MarkupSafe==1.1.0
monotonic==1.5
msgpack==0.6.0
numba==0.42.0
numpy==1.16.0
Expand Down
6 changes: 3 additions & 3 deletions solidata_api/_core/queries_db/query_insert_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def Query_db_insert (

### check if doc already exists
document = db_collection.find_one( filter_doc )
log.debug('document : \n%s', pformat(document) )
# log.debug('document : \n%s', pformat(document) )


### retrieve system user's OID
system_user = db_dict_by_type['usr'].find_one( { 'auth.role' : user_role } )
log.debug('system_user : \n%s', pformat(system_user) )
# log.debug('system_user : \n%s', pformat(system_user) )

# check if system user exists
# system_user exists
Expand All @@ -75,7 +75,7 @@ def Query_db_insert (

### marshall infos with new_doc complete model
new_doc_in = marshal( new_doc , models["model_doc_in"])
log.debug('new_doc_in : \n%s', pformat(new_doc_in) )
# log.debug('new_doc_in : \n%s', pformat(new_doc_in) )

### complete missing default fields
if document_type != "usr" :
Expand Down
1 change: 1 addition & 0 deletions solidata_api/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from flask import Flask, g, current_app


### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
### FLASK-EXTENDED-JWT IMPORTS
### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
Expand Down
8 changes: 8 additions & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

from log_config import log, pformat

### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
### FLASK-SOCKETIO
### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
from flask_socketio import SocketIO

from solidata_api.application import create_app

app = create_app( app_name='SOLIDATA_API', run_mode="prod" )
Expand All @@ -11,4 +16,7 @@

log.debug("\n--- STARTING SOLIDATA API (PROD) ---\n")

### initiate socketio
socketio = SocketIO(app)

app.run()
8 changes: 8 additions & 0 deletions wsgi_preprod.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

from log_config import log, pformat

### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
### FLASK-SOCKETIO
### + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ###
from flask_socketio import SocketIO

from solidata_api.application import create_app

app = create_app( app_name='SOLIDATA_API', run_mode="preprod" )
Expand All @@ -11,4 +16,7 @@

log.debug("\n--- STARTING SOLIDATA API (PREPROD) ---\n")

### initiate socketio
socketio = SocketIO(app)

app.run()

0 comments on commit 61308e1

Please sign in to comment.