F
F
fefwefwe2018-11-21 10:01:19
PHP
fefwefwe, 2018-11-21 10:01:19

Algorithm YML-importer of goods with pictures, what are the pitfalls?

It is necessary to implement on the site the import of goods from the YML file, where there are pictures.
Do you have a finished bike?
It will be launched every day by krone.
I thought to release it like this: I
run cron - I add all new products, and the names of the pictures in a special table of temporary files.
Where already the second task will read them and download pictures.
Probably it is necessary to start with set_time_limit (0); what would not be desirable.
What are the pitfalls in this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-11-21
@402d

run cron once a minute. in the script, control the time since the launch, if
more than 25 seconds have passed, finish the download. 35 seconds out of a minute in this case does not interfere
with surfing the site normally. (you can set a time limit of 59 seconds and end on the 50th).
everything spins in a loop until the time has expired
1) take the next picture from the database
if there is none, finish the execution
2) download
3) save
4) resize
5) mark as downloaded

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question