Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Jquery/Ajax update database every x minutes
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Kaz" data-source="post: 366266" data-attributes="member: 1611"><p>Whether they are online or not. It needs to run</p><p></p><p>Basically the user will have energy, max_energy, stamina & max_stamina</p><p>If the users current stamina is less than max_stamina, + 1 it when their time is due. If they are equal, do nothing. Same for energy.</p><p></p><p>However user 1, may have their times as followed: energy, increases every 5 minutes, and stamina increases every 4 mins 20</p><p>User 2 however, may have these times: energy, increases every 4 mins 20, and stamina increases every 3 mins 50.</p><p>And the remaining users may have energy and stamina both at 5mins due to them being inactive.</p><p></p><p>Which leads me back to the questions would I need to have multiple crons set for each 'timer'?</p><p></p><p></p><p></p><p>Would that not mean I would need to have a cron set every second? </p><p>Simply due to the fact that not all users will have the same updated timestamp, as updating said field (more info in my response to rasta) would need to happen as and when the time reaches zero, ready to restart its loop from said users timer, rather than updating when a check is in place as it would not be instant</p></blockquote><p></p>
[QUOTE="Kaz, post: 366266, member: 1611"] Whether they are online or not. It needs to run Basically the user will have energy, max_energy, stamina & max_stamina If the users current stamina is less than max_stamina, + 1 it when their time is due. If they are equal, do nothing. Same for energy. However user 1, may have their times as followed: energy, increases every 5 minutes, and stamina increases every 4 mins 20 User 2 however, may have these times: energy, increases every 4 mins 20, and stamina increases every 3 mins 50. And the remaining users may have energy and stamina both at 5mins due to them being inactive. Which leads me back to the questions would I need to have multiple crons set for each 'timer'? Would that not mean I would need to have a cron set every second? Simply due to the fact that not all users will have the same updated timestamp, as updating said field (more info in my response to rasta) would need to happen as and when the time reaches zero, ready to restart its loop from said users timer, rather than updating when a check is in place as it would not be instant [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Jquery/Ajax update database every x minutes
Top