Skip to main content

All Questions

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 ...
Bilal Zafar's user avatar
-1 votes
1 answer
624 views

Does the thread can terminate when call OpenCV release() method?

The ThreadedCamera Class that get frame from thread. I have two questions. Q1: Will it affect program performance if I don't close threads when I create a lot of ThreadedCamera classes? Q2: Does the ...
Creek's user avatar
  • 215
4 votes
2 answers
3k views

Threading Tasks Queue in Flask [duplicate]

Hey guys so I'm building a websocket using flask and I'm currently creating a new thread for every request so that thread can do some heavy processing and not take too much time to return something ...
DeadSec's user avatar
  • 888
0 votes
1 answer
321 views

Flask server using asynchronous Rpc client only answer 1 request out of two

I'm trying to implement an async RPC client within a Flask server. The idea is that each request spawn a thread with an uuid, and each request is going to wait until there is a response in the ...
Gautier A.'s user avatar
1 vote
0 answers
21 views

Too many threads are getting generated Python flask [duplicate]

I am working in a startup company where one of our microservice is in Python Flask and another in Java Spring. Between java and python code there is an asynchronous call for one task. When Python API ...
ABHISHEK KUMAR SINGH's user avatar
2 votes
1 answer
787 views

Thread in python gets started twice on heroku

I have an app that runs in its own while true loop, but I want it to be interactable via a website, so my approach was to run the app on a separate thread and use flask with gunicorn, but that led to ...
Esh's user avatar
  • 516
0 votes
1 answer
129 views

How to start a background Thread within a Flask app?

I wrote a Flask app that is working fine, and I wanted that while it is running, a separate background thread should parallel to it doing some stuff. The problem is, doing this doesn't spawn the ...
Sohail Saha's user avatar
1 vote
1 answer
2k views

Python Thread - Memory not released

I need to generate a job-id for user-request call which I thought of handling it through python-theading using below block: from flask_restful import Resource from flask import ...
Mohamed Niyaz's user avatar
1 vote
0 answers
882 views

Flask: how to write to SQLAlchemy DB when multithreading?

I am using multithreading in a Flask app and want each thread to append to an entry in a database. However, I can never get this to work. Per Multi-threaded use of SQLAlchemy I have something like the ...
ZhouW's user avatar
  • 1,217
2 votes
3 answers
1k views

Why child threads cannot access the current_user variable in flask_login?

I am writing a Flask application and I am trying to insert a multi-threaded implementation for certain server related features. I noticed this weird behavior so I wanted to understand why is it ...
Robb1's user avatar
  • 5,027
1 vote
1 answer
824 views

flask-sqlalchemy - how to obtain a request-independent db session

I am looking at the best (and correct way) to obtain a request-independent db session. The problem is the following: I am building a web application that has to access the database. The endpoint ...
Andrea Zanotti's user avatar
-2 votes
1 answer
45 views

What is the best way to terminate a thread in python?

I am implementing a Flask application and I'm calling a function A, based on a request. Inside the function A, there is another function called B and it is called. But, I don't need to wait until the ...
Ayesh Weerasinghe's user avatar
0 votes
1 answer
471 views

Flask redirect or return data from nested view function

I am trying to run code from a view on a GET request. This code is executed in a new thread because it takes some time to run. Note that I am not joining the thread because then the view would hang. I ...
APorter1031's user avatar
  • 2,286
0 votes
2 answers
731 views

Threading an external script within a Flask app

I have a Flask app that is using external scripts to perform certain actions. In one of the scripts, I am using threading to run the threads. I am using the following code for the actual threading: ...
Excalibur's user avatar
-1 votes
1 answer
243 views

Python threading script execution in Flask Backend

Currently i'm trying to use proper threading to execute a bunch of scripts. They are sorted like that: Main Thread (Runs the Flask app) -Analysis Thread (Runs the analysis script which invokes all ...
Christoph Pelzer's user avatar

15 30 50 per page