japronto icon indicating copy to clipboard operation
japronto copied to clipboard

Japronto getting blocked/hanged

Open spawn08 opened this issue 7 years ago • 3 comments

Hey guys I have three end points "/", "/train", and "/classify". When im specifying the worker > 1,in my case it is 4 (app.run(host...,port...,worker=4)). My "/" route is working fine but as soon as I go to route "/train" and "/classify", japronto is getting blocked/hanged. im not getting any response from the server and postman just keep "loading.."

async def train(request): train_network_sanic.train() return request.Response(text="training successfull")

async def classify(request): sentence = request.query.get('query') return_list = train_network_sanic.classify(sentence) return request.Response(text=str(return_list))

app = Application() app.router.add_route('/', hello) app.router.add_route('/api/train',train) app.router.add_route('/api/classify',classify) app.run(host='0.0.0.0', port=8000,debug=True,worker_num=4)

This is what my code looks like for route "/train" and "/classify". can anybody help?

spawn08 avatar May 09 '18 12:05 spawn08

Just at first sight, async coroutines are not supposed to yield instead of returning?

Mec-iS avatar May 09 '18 13:05 Mec-iS

im not using yield anywhere in the code?

spawn08 avatar May 09 '18 13:05 spawn08

@squeaky-pl any help??

spawn08 avatar May 23 '18 08:05 spawn08