There are two problems:
- do not do print, breaks mod_wsgi
- do not start threads from an action because the threads are
controller by the web server and it may kill it.

you should queue the task in database or cache and then run a
background task.
If pushing data to redis takes too long it defies the purpose of using
redis.

On Oct 9, 11:22 pm, Mike Veltman <[email protected]> wrote:
> Ok, I need to push data in a redis database. And my problem is that it takes a
> while while the data is pushed in. So the screen would be waiting and a user
> would be irritated.
>
> My solution would be something like this.
>
> if framequeue.check_frame_lock() == False:
>         if session.deployment == True:
>             pass
>         else:
>             import thread
>             print session.deployment
>             print "Running deployment"
>             thread.start_new_thread(default_frame_deployment,())
>
> So the thread is running in the background and the page displays the log.
>
> But then I get gluon (database) errors in the functions.
>
> Any idea's or is there a better/ more elegant solution to this problem ?
>
> With regards,
> Mike Veltman

Reply via email to