So I guess this is a bug. Can you take a look at this, Achipa? Here is
what I did.

1. I am running web2py_win.zip, the windows distribution bundle, v
1.56.3, on a Windows XP Home edition 5.1.2600, SP3.

2. For simplicity, I have this in my controller/default.py
  def trigger():
    import logging
    logging.warn('trigger() says hi')
And this in my cron/crontab
  */1   *       *       *       *       root *applications/myapp/cron/trigger.py
And this is the cron/trigger.py
  import urllib
  urllib.urlopen('http://%s/myapp/default/
trigger'%request.env.http_host).read()

3. Then I start web2py by:
  web2py.exe -a1 -D1
This shall result in a hardcron, isn't it? The output on console is
nothing special. However, trigger is not invoked automatically after
minutes and minutes...

4. Then I manually visit http://localhost:8000, this time the trigger
is pulled, the console gives lots of output include the wanted
"WARNING:root:trigger() says hi". However, nothing happened one more
minute later, unless I manually visit http://localhost:8000 one more
time.

DEBUG:root:Cronmaster stamp: 1235287173.69, Now: 1235287374.81
INFO:root:WEB2PY CRON (soft): Application: myapp executing
*applications/myapp/cron/trigger.py in C:\DOWNLOAD\web2py at
2009-02-22 15:22:54.812000
DEBUG:root:Cronmaster stamp: 1235287374.81, Now: 1235287375.02
DEBUG:root:Cronmaster stamp: 1235287374.81, Now: 1235287375.05
DEBUG:root:Cronmaster stamp: 1235287374.81, Now: 1235287375.06
DEBUG:root:Cronmaster stamp: 1235287374.81, Now: 1235287375.08
DEBUG:root:Cronmaster stamp: 1235287374.81, Now: 1235287375.39
DEBUG:root:Cronmaster stamp: 1235287374.81, Now: 1235287375.52
WARNING:root:trigger() says hi
DEBUG:root:Cronmaster stamp: 1235287374.81, Now: 1235287376.2
DEBUG:root:WEB2PY CRON done
INFO:root:WEB2PY CRON Call returned: default applications appear to be
installed
 already
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2009
Version 1.56.2 (2009-02-08 21:49:34)
Database drivers available: SQLite3, MySQL


On Feb22, 7:53am, AchipA <attila.cs...@gmail.com> wrote:
> On Feb 21, 6:28 pm, Iceberg <iceb...@21cn.com> wrote:
>
> > Now I am using web2py_win.zip, 1.56.3, without any other web server,
> > so I think it qualifies for a hardcron mode, am I correct? But I tried
> > and found that my cron jobs are still in softcron mode, a.k.a. "cron
> > routines are checked after page content has been served, does not
> > guarantee execution precision".
> > Did I miss something? Thanks in advance.
>
> If you run web2py with "python web2py.py" that should be hard cron. If
> you specified no additional switches or changed it in code and it
> still runs as soft-cron then it's a bug :) The easiest way to check
> this is to run web2py with "python web2py.py -D 1" to enable debug
> mode, it will output more info about the cron task execution. Also,
> can you tell me what OS you are using and if you are running web2py
> from source or from a distribution bundle ?
>
> On Feb 21, 9:12 pm, David Marko <dma...@tiscali.cz> wrote:
>
> > I would also appreciate some working example/appliance for using
> > *cron. Its very usefull thing!!!
>
> web2py comes with an example (cleaning sessions), see applications/
> admin/cron ! Do you think additional examples should be put there, or
> that maybe new applications should include a template commented out
> crontab ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to