If "periodically from the time of saving" is a must and you also need to 
refresh the data changes in real time, not, for example, retroactively, 
once per hour, then I suggest using the web2py's Scheduler. It's in the 4th 
chapter of the book. Otherwise a regular system's cron job would be enough.

Regards


On Tuesday, April 14, 2015 at 1:34:56 AM UTC+2, sasogeek wrote:
>
> I want to do something but I doubt cron is the right thing to attempt, I'm 
> not even sure what I'm supposed to do except that it's going to be a 
> scheduled task and it may or may not be solved by cron, I need some 
> guidance.
>
> I want to simulate a bank. users get to 'save' some (virtual) money in the 
> 'bank', and every hour (in real time, periodically from the time of 
> 'saving') they earn some percentage of their saved money.
>
> for instance, every hour, 
> balance = db(db.bank.account_id == 
> auth.user.bank_account_id).select().first().balance
> db(db.bank.account_id == 
> auth.user.bank_account_id).update(balance=balance+(0.0001*balance))
> or something like that.
>
> how do i do this?
>

-- 
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