I have a products database that synchronizes with product data ever morning.
The process is very clear:
- Get all products from database by query
- Loop through all products, and get and xml from the other server by product_id
- Update data from xml
- Log the changes to file.
If I query a low amount of items, but limiting it to 500 random products for example, everything goes fine. But when I query all products, my script SOMETIMES goes on the fritz and starts looping multiple times. Hours later I still see my log file growing and products being added.
I checked everything I could think of, for example:
- Are variables not used twice without overwriting each other
- Does the function call itself
- Does it happen with a low amount of products too: no.
- The script is called using a cronjob, are the settings ok. (Yes)
The reason that makes it especially weird is that it sometimes goes right, and sometimes it doesnt. Could this be some memory problem?
EDIT
wget -q -O /dev/null http://example.eu/xxxxx/cron.php?operation=sync
its in webmin called on a specific hour and minute
Code is hundreds of lines long...
Thanks