oops I see the post now.
On Jul 28, 2010, at 5:06 AM, Massimo Di Pierro wrote:
The solution is cache.disk
> PS: Using cache.disk() is not (yet) a workaround for
web2py_win.zip. I
> report a bug about that in another post.
I do not recall this. Can you tell us more and point to the post?
Massimo
On Jul 28, 2010, at 4:48 AM, Iceberg wrote:
Scenario: In one of my small enterprise app, my action is time
consuming, so I use cache. Furthermore, I setup a cron job to "touch"
this action frequently, hoping that other real users will be
benefited
by always have cache hits. Example as below.
@cache(request.env.path_info,time_expire=1800,cache_model=cache.ram)
def index():
result = do_a_time_consuming_job()
return {'result': result}
# the crontab file
*/30 * * * * root **default/index
Nice plan, huh? But it has no effect. Because each time the cronjob
is
seemingly invoked in a separated process space (via "web2py -P -N -
M -
S myapp/default/index -a <recycled>"), so the main process's
cache.ram
is not touched.
So, is it possible to change the implementation, let the "visit my
action" cronjob be done by this way?
urllib.urlopen('http://localhost:8000/myapp/default/index').read()
By the way, my current workaround is to write my crontab file like
this:
*/30 * * * * root
**applications/myapp/cron/trigger.py
and my trigger.py is based on urlopen(...).read() mentioned above.
The workaround works, but I don't like the fact that it hardcode the
app name (as well as the port).
PS: Using cache.disk() is not (yet) a workaround for
web2py_win.zip. I
report a bug about that in another post.
So, what's your opinion?
Regards,
Iceberg
--
mail from:GoogleGroups "web2py-developers" mailing list
make speech: [email protected]
unsubscribe: [email protected]
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
--
mail from:GoogleGroups "web2py-developers" mailing list
make speech: [email protected]
unsubscribe: [email protected]
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/