python - Bottle server not responding while calculating -


i have bottle server running on port 8080, using "gevent" server. use server support simple "server sent events".

my question related not knowing how set working. hope can take time elaborate on this.

all routes , serving of files server working great, have issue when accessing specific route "/get_data". gathers data web internal data sources. gathering takes 30 minutes. while process running, not able access routes on server, i.e. "/" or "/login". once process finished, works again , database updated gathered information.

i tried replacing gathering algorithms simple time.sleep(60), , while timer active, still able access other routes fine.

this leads 2 questions:

  1. why not able access server while process running. port blocked (from reading web-information), or maybe has threading?
  2. what best way run demanding / long process on server? preferably access web app, have thought putting in seperate python file , run localy on server, in seperate instance of python. process run @ once per day, maybe seldom once per week.

this happen because wsgi handle request/response synchronously.
can use gunicorn run application, handle multi requests , response, or can use other methods described in bottle website:
primer asynchronous applications


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -