[web2py] Re: Cron issue with recent web2py?

2010-02-27 Thread Magnitus
Running on Windows Vista here. I notice that the CPU spikes at about 60% for a fraction of a second every minute or so, but it does that whether web2py is running or not (probably my anti-virus or another process running in the background). I don't notice multiple python processes spawning or the

[web2py] Re: cron issue

2010-02-08 Thread John Heenan
Hi AchipA I think most of the work is done already with regard to how to set up the environment and do an exec without Popen. If you take a look at the run function in gluon\shell.py it has the signature below. I don't see why the run function cannot be copied and edited with a small number of ch

[web2py] Re: cron issue

2010-02-08 Thread AchipA
John, I did not mean fight about principles or dismiss your suggestion. I perfectly understand what you need and see that rationale in it. It's just that if I'm doing an overhaul, I'd like to do it right - leaving to the users to 'behave' and not shoot themselves in the foot is something I'd like t

[web2py] Re: cron issue

2010-02-08 Thread AchipA
On Feb 8, 8:22 pm, mdipierro wrote: > On Feb 8, 11:43 am, AchipA wrote: > > > 1) ok > > 2) this would be the cron.master file. Sadly, it must be a file as > > otherwise multiprocess setups (like wsgi) would trip over each other. > > ok. but there should be a function to check its status. > to mak

[web2py] Re: cron issue

2010-02-08 Thread John Heenan
Since AchipA is working on other changes to cron.py and cron.py is his, I think I should wait to see if AchipA includes additons with Massimo's preferred format below before being so bold as to submit a patch myself. John Heenan On Feb 9, 10:54 am, mdipierro wrote: > I have no objection to addin

[web2py] Re: cron issue

2010-02-08 Thread mdipierro
I have no objection to adding this feature. I do not like the !*" prefix. I think we can do: @hourly root file -> exec file in Popen @hourly root file.py -> exec file in Popen with python @hourly root *file.py -> exec file in Popen with python -S -M -R @hourly root **file.py -> exec file in Pop

[web2py] Re: cron issue

2010-02-08 Thread John Heenan
Hi I stated "My point is can we have an option to:" Maybe I should code up a patch for cron.py and submit it for examination. Cron.py is impressive, I am not criticising it or attacking its approach. The option I am requesting are ADDITIONS to cron.py that are TRIVIAL to code in as additions to

[web2py] Re: cron issue

2010-02-08 Thread mdipierro
On Feb 8, 11:43 am, AchipA wrote: > 1) ok > 2) this would be the cron.master file. Sadly, it must be a file as > otherwise multiprocess setups (like wsgi) would trip over each other. ok. but there should be a function to check its status. to make sure... what I mean is a way to check not if it

[web2py] Re: cron issue

2010-02-08 Thread AchipA
1) ok 2) this would be the cron.master file. Sadly, it must be a file as otherwise multiprocess setups (like wsgi) would trip over each other. 3) I'm thinking of deprecating posttasks in favor of being able to daisy-chain controllers. So you would not have posttasks, but you could specify a control

[web2py] Re: cron issue

2010-02-08 Thread mdipierro
I agree that Popen is a better solution and I would not change anything in cron.py. I would only like: 1) move crontype into gluon.settings and use the variable to determine the type of cron. Currently this is a global variable almost useless to determine which type of cron is on. 2) add a variabl

[web2py] Re: cron issue

2010-02-08 Thread AchipA
Fiddling with this now, but have a few concerns, so I'd like Massimo to chime is as the exec expert. The main reason for going POpen is to have a clean, thread safe environment, and with exec I'm not sure we won't hit race conditions or deadlock possibilities, especially if we touch on models. Some

[web2py] Re: cron issue

2010-01-31 Thread mdipierro
Got it now. On Jan 31, 12:27 am, John Heenan wrote: > I have not get my point across. > > By 'Python exec' I mean using the 'exec' internal Python command. I > don't mean 'Python exec' as a shorthand for 'execute a new Unix, > Windows or Mac OS process under the ownership of the cron code written

[web2py] Re: cron issue

2010-01-30 Thread mdipierro
Unless we misunderstand we have that already. The file just needs to end in .py as in * * * * * root myscript.py You can also call actions * * * * * root *myscript.py so that models are imported. On Jan 30, 8:36 pm, John Heenan wrote: > Hi AchipA > > Another feature request, if the cron file

[web2py] Re: cron issue

2010-01-30 Thread John Heenan
Hi AchipA Another feature request, if the cron file is a python file, how about a cron option to open the file and do an exec on the file contents? Thanks John Heenan On Jan 31, 12:33 pm, John Heenan wrote: > Hi AchipA > > Your cron is nice work and neatly deals with the messy side of > launc

[web2py] Re: cron issue

2010-01-30 Thread John Heenan
Hi AchipA Your cron is nice work and neatly deals with the messy side of launching an independent OS process and waiting for it to finish. For those of us who do not wish to launch an independent process (to keep down memory use) and are happy to stick with Python for cron jobs, following is a re

[web2py] Re: cron issue

2010-01-30 Thread mdipierro
Ignore my email below. This was about routes.py not cron. I got confused. On Jan 30, 2:32 pm, mdipierro wrote: > On Jan 30, 10:44 am, Oguz Yarimtepe wrote: > > > On Tue, 26 Jan 2010 07:00:25 -0800 (PST) > > > mdipierro wrote: > > > I am not sure if tasks staring with * or ** run under extcron s

[web2py] Re: cron issue

2010-01-30 Thread AchipA
Just to chime in, I'm still alive and preparing an update to cron as quite a few things changed since I last touched it. As for the questions - all cron modes support the * and ** syntax, and yes, cron files can be modified on the fly. On Jan 26, 4:00 pm, mdipierro wrote: > I did not write cron p

[web2py] Re: cron issue

2010-01-30 Thread mdipierro
On Jan 30, 10:44 am, Oguz Yarimtepe wrote: > On Tue, 26 Jan 2010 07:00:25 -0800 (PST) > > mdipierro wrote: > > I am not sure if tasks staring with * or ** run under extcron so I > > suggest not using pycron. Given hardcron you do not need pycron > > anyway. > > > Mind that this is in the proces

Re: [web2py] Re: cron issue

2010-01-30 Thread Oguz Yarimtepe
On Tue, 26 Jan 2010 07:00:25 -0800 (PST) mdipierro wrote: > I am not sure if tasks staring with * or ** run under extcron so I > suggest not using pycron. Given hardcron you do not need pycron > anyway. > > Mind that this is in the process of being refactored a bit. Perhaps > you can help with t

[web2py] Re: cron issue

2010-01-26 Thread mdipierro
I did not write cron personally and I am still trying to understand some of it, Attila did. I am in the looking at cron these days to treamline it a bit and I am trying to understand better as it works. Since windows does not have cron, you should use web2py hardcron. It should work on windows 7 b