All Questions
Tagged with python-multithreading flask
92 questions
0
votes
0
answers
37
views
Launch only one background task with multiple Gunicorn workers
I have a flask application that I run with Gunicorn.
The application itself would ideally be run with multiple workers. I also have some data I need to consume from Kafka, but that should only be one ...
0
votes
0
answers
25
views
Flask App Randomly Restarting When Running with Apache and mod_wsgi
I'm having an issue with a Flask application that I'm running using Apache and WSGI on a Raspberry Pi. The application restarts intermittently, and it seems that Apache is restarting the application ...
0
votes
0
answers
51
views
Background thread stops unexpectedly and silently when cleaning up batches in Flask app
Question:
I am working on a Flask application where I need to periodically clean up stale batches in the database. To avoid unnecessary processing, I set up a background thread that checks for ...
0
votes
0
answers
46
views
The problem of continuously refreshing data from the threading section of socketio.on in the flask back end in a multi-user environment
This is the first time I use flask as the backend, and I expect the data on my web page to be updated every 200s. So I use while true with time.sleep (200) in each module and transfer the data via ...
0
votes
0
answers
36
views
Why is my main thread immediately stopping and exiting?
I'm implementing two-sided conversation transcription using Python Flask and React.js.
I'm getting audio streams from microphone and speaker using the Python SoundCard library.
I'm transcribing from ...
0
votes
0
answers
23
views
Pushing app context of parent thread in subthread doesnt work
I have an app with following architecture:
/app is where all code is stored, /reports - for reports generated via ydata_profiling.
The idea is to show user some wait-page with "pls wait" on ...
0
votes
0
answers
24
views
Updating a websocket connection in a single thread in Flask application
I have a flask up with an endpoint like below
@app.route('/update_tokens', methods=['POST'])
async def update_tokens():
# global variables
data = request.get_json()
auth_token = data['...
0
votes
0
answers
20
views
Python server that simulates an ML training process with Flask and SocketIO (issues with multithreading & multiprocessing)
I am trying to create a client-server app in which the client can send a HTTP request with files to the server to start a process of training an AI model. I want the client to be able to get updates ...
0
votes
1
answer
135
views
Setting a watch function using kazoo when calling Zookeeper from a Flask application deployed using gunicorn
I have a Flask application deployed using gunicorn. I'd like to integrate the application with a Zookeeper ensemble using kazoo, as the app relies on having up to date data from a get_children() call ...
0
votes
1
answer
298
views
Python Flask App not running Thread on Azure
My code is working fine on localhost but the thread is not working when deployed on Azure.
Code looks something like this:
from flask import Flask, request
from side import querying, send_message
...
0
votes
1
answer
404
views
flask_executor future.result() throws TypeError: 'str' object is not callable
I'm trying to get result from the process that I created to run in the background using flask_executor. This are methods in use:
def scan_and_collect( self ):
self.data_collector.collect()
...
0
votes
1
answer
618
views
Python threading Flask - do I need to close my thread using x.join()?
I have some code in Python Flask which does the following:
get user input
calculates (0.3s)
writes to DB (3s)
return view to user
Currently the user has to wait 3.3s for the view to return to them, ...
1
vote
1
answer
116
views
Email component in flask application is not able to access the app instance in an application factory pattern
I am practising flask. I have made a simple flask app which sends an email to the admin saying "New User has joined." once someone enters their name and submit on the form.
This is email ...
1
vote
1
answer
118
views
I'm getting the wrong request sent to wrong account when using python requests
I'm using a Python requests library for a Flask app, which is hosted on Heroku. I implemented a task using threading which will fetch the data from the other app indefinitely until the user stops it ...
1
vote
1
answer
85
views
Using threading in flask to train a model parallelly
from threading import Thread
def model_training():
global status
for i in range(1, 11):
status = i
sleep(1)
@app.route('/retrain/', methods=['GET', 'POST'])
def retrain():
...