AlabamaHit Posted May 12, 2008 Share Posted May 12, 2008 Anyone point me in the right direction? I want to experiment on running a site without crons...Say a game cause thats what I willl be testing it on...I have heard there are easy ways to this.....lol...just wonderin if someoen could help me out. :mrgreen: Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted May 12, 2008 Share Posted May 12, 2008 Re: No Crons Well you could use unix_timestamp of course, but in other cases it could cause lag, and it will only update if some one is clicking the hole time. Quote Link to comment Share on other sites More sharing options...
Floydian Posted May 12, 2008 Share Posted May 12, 2008 Re: No Crons You need to get real good at using time stamps. if (jailtime > time()) then you're in jail that negates the need to do a minute cron updating jail time follow that mold and you'll likely be able to eliminate most of the crons It's my opinion that some things are best left to crons. If you want something updated once per day, for all users, and it's something that if you performed a check to see if that update was necessary on every page load, it'd consume far more resources than just doing a daily cron. On Tycoon Rats, I use a cron for updating user bars, and a daily cron. That's it. there is no minute cron, or five minute cron. Just a 10 minute and a daily. I prefer to update user bars with crons because I want players that log off to be able to come back to a full bar, instead of requiring activity on their part. If you want their bars fully updated, then there's some math involved, and it has to be performed regularly, say something like: if last update > time() - 60 * 10 THEN do an update, but there's more how many updates did we miss? missed updates = ((time() - 60 * 10) - last update) / 10 now multiply the amount you update by the "missed updates" amount all of this should be self explanatory, if it isn't, then you need to practice with time stamps or you'll muck it up. Quote Link to comment Share on other sites More sharing options...
threeZ Posted June 13, 2008 Share Posted June 13, 2008 Re: No Crons or you could check this out... http://phpjobscheduler.co.uk works like a champ Quote Link to comment Share on other sites More sharing options...
Floydian Posted June 13, 2008 Share Posted June 13, 2008 Re: No Crons To be technical there isn't a lot of difference between that php schedualler and a cron. I think Alabama is wanting to eliminate the need for schedualling ANYTHING. I could be wrong, but that was my impression. Certain, that php schedualler is NOT going to be as efficient as using crons, so why would one migrate? Looking at their documentation, php schedualler is designed to be a solution for folks that don't have access to cron jobs. And for that purpose, it seems like a fantastic solution to that particular situation. But using it to replace cron jobs, is not a good idea IMHO. Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted June 13, 2008 Share Posted June 13, 2008 Re: No Crons Agreed - any type of fake cron system will ~can~ suffer from some sort of performance hit as it plays catchup. IMO, Floydian presents the skeleton of a possible solution, using timestamps to track activity, it gets a little tricky at times, but I've successfully integrated into one project. Quote Link to comment Share on other sites More sharing options...
Floydian Posted June 14, 2008 Share Posted June 14, 2008 Re: No Crons Thanks Nyna ;) Time stamps work fantastic for things like hospital time. Set the timestamp once, to a future date. Done deal. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.