sql - Automated Heroku PostgreSQL Updates without Client Request -
i new web development. building simple text based web game. using heroku , postgresql. have sql table users , coin amount(their earnings).
i can receive/transmit info database using requests made players. want accomplish automate coin add-on each users account.
so let's @ origin of each hour, want add together 15 coins each user. how can possible accomplish kind of automation heroku , postgresql ?
i tried searching hour, wasn't able find name of process :(
while schedule (as sonnyhe notes), it's improve not to.
instead, update value when you're updating balance other reason, adding difference between time lastly added coins , current time, extracting hours, , multiplying 15.
if user asks view balance, need display lastly stored value plus hours since * 15.
that way you're not doing lots of unnecessary updates , causing unnecessary load.
sql ruby-on-rails postgresql heroku
No comments:
Post a Comment