flask icon indicating copy to clipboard operation
flask copied to clipboard

how to set flask session key value in multithreading

Open Set4now opened this issue 6 years ago • 1 comments

same code:-

def long_task(i):
    
   
        # global session
        print "started executing for {}".format(i)
    
        time.sleep(5)
        print "working"
        session['step1'][i]["status"] = 'Completed'


executor.submit(long_task, current_app._get_current_object(), i)

Set4now avatar Feb 11 '20 13:02 Set4now

Please use Stack Overflow for questions about your own code. This tracker is for issues related to the project itself. Be sure to include a minimal, complete, and verifiable example.

davidism avatar Feb 11 '20 13:02 davidism