> On 8 sep 2009, 07:36, mdipierro <[email protected]> wrote: >> Not elegant but you can do this... >> >> def index(): >> import subprocess >> subprocess.Popen('python web2py.py -S yourapp -M -S >> yourscript.py') >> do something else >> > > why is it not elegant? I only can find of doing this using a queue run by cron, as you suggested in http://groups.google.com/group/web2py/browse_thread/thread/5b682d1b120a6057/d52e8d2a29310e6f What would a more elegant solution would be?
This is a kind of problem many applications will have when they are not pure web applications, but web interfaces to do something that requires running (and, often, wait for) tasks that can take a long time to be executed. A better (an elegant) idea on how to solve to this kind of problem would be great. Thanks. José L. >> On Sep 7, 11:58 pm, Adi <[email protected]> wrote: >> >> >> >> >> >> >> >> > Nope. This requires running the conversion module independently from >> > the command line. Any other help with this? >> >> > On Sep 4, 11:15 am, mdipierro <[email protected]> wrote: >> >> > > check if this does what you >> > > need:http://www.web2py.com/appliances/default/show/38 >> >> > > Massimo >> >> > > On Sep 3, 11:34 pm, Adi <[email protected]> wrote: >> >> > > > Hi, >> >> > > > I'm new to web2py. I have this requirement - on loading a page, I want >> > > > to trigger a backgroundprocessautomatically. Since theprocessis >> > > > time-consuming, I don't want user to wait. >> >> > > > This is what I tried - running the backgroundprocessas a separate >> > > > thread. This results in >> >> > > > ProgrammingError: Cannot operate on a closed database. >> >> > > > I read another thread with the same subject, it spoke of "refreshing >> > > > the value of DB in environment dictionary". How can I do that? And why >> > > > do I need to do it? >> >> > > > What is the better way to achieve what I want?

