Skip to content

Commit

Permalink
Added gunicorn.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
udaya2899 committed Jul 27, 2020
1 parent 0d03174 commit 6da4fd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ def api():
logging.info("Request received, response: %s", last_extracted_content)
return jsonify(last_extracted_content)

def start_thread():
threading.Timer(10, data_extract, ()).start()

if __name__ == "__main__":
logging.info("****** COVID-INDIA-API *******")
threading.Timer(10, data_extract, ()).start()
app.run(debug=True)
app.run(debug=True)
3 changes: 3 additions & 0 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def post_worker_init(worker):
from app import start_thread
start_thread()

0 comments on commit 6da4fd8

Please sign in to comment.