![]() |
Need Cron Suggestion
I want to use cron to update select information on my board a select day of the week. my problem is that the source i use to update that information only allows 10 results at a time and 1-2 second delay between each query. What I want to do is be able to do the entire table at intervals of 10. how would i do this?
sorta like when you run update user titles script where u can choose how many users to update in a cycle |
Just put a:
PHP Code:
|
k but how would i like make it split everything into pages without having the url change into scirpt.php?page=xx or is that how i should do it?
|
ok still awaiting an answer if its ok to use redirect with vb cron...
|
No i think, and on second thought my suggestion to use a sleep is also not a good one.
Best would be to keep somehow track of progress, and just continue where you left each time the job is run. |
drrss, well i dont want to create a billion cron jobs if say i have 1,000 things to update>_> any other suggestions...
|
just bumping to see if there any more suggestions;)
|
bumping up again for suggestions please:)
|
Sorry, I don't really understand what you are trying to do.
|
im trying to design a script that will grab x items from a table then contact a web service to get updated information on those x amount items. the problem is that the web service only allows 1 query per x seconds and can only return 10 items per query but i want to do the entire table which has 200+ items. so that is my problem...
|
Just add a column to the items 'last_queried' and put a timestamp in it when it gets queried. Then do a "SELECT * FROM items ORDER BY lastqueried DESC LIMIT 10" or something like that.
|
well i am going to do that but thats only 10 i need to multiple tens since i have more than 10 items
|
Well the next page load it will do the next 10.
|
so how would i make the script reload with cron?
|
you don't want to reload the script with cron.
Just have the cron job run every minute or so. |
Sounds like the Amazon API. :)
You will not be sucessful with a vB cron job if so. Even if it's not amazon, those one second delays are common in xml feeds generally, so you should look at using the API for the feed and update items when requested with live data. Cache only item numbers, get the rest live. I did this with FREEBS - Free Book Store for amazon. Keyword specific books are on file, however any book listed on amazon can be displayed on YOUR site if requested. Even if you purge your DB and have no books on file, if a user requests a URL from the search engines, you will still be able to display the book. |
well i want it to only run between a certain time of the day
im trying to avoid grabbing live data on the spot because load times are unexceptable |
All times are GMT. The time now is 07:15 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|