I'm confused as to why this scenario needs caching.

Isn't it true that for an empty user table:

if cache.ram('init',lambda:db(db.auth_user).isempty(),None):
   arbitrary_function()

will only cache the boolean value True and keep that value (True) in cache 
forever (until the app is restarted), associated with the given key 'init'?

Therefore, only this initial state is remembered. All future executions of 
this code will only ever return this initial value (True), therefore the 
subsequent arbitrary function will continue to be executed every cycle of 
execution.

Am I missing something? Many thanks!



On Friday, August 10, 2012 11:23:56 PM UTC-4, Massimo Di Pierro wrote:
>
> you stil want to cache that
>
> if cache.ram('init',lambda:db(db.mytable).isempty(),None):
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to