Answer the question
In order to leave comments, you need to log in
What algorithm of actions should be done to update the script without any problems?
In general, I will state it as best I can, if you write something in the comments, I will add it if something is not clear:
1) In a nutshell, there is a database with user avatars. Of the columns that are involved in the question - 2: photo_local and photo_ex
The parser parses avatars and photo_ex contains the url to the picture on the external site. Then it saves the picture locally and writes the path to photo_local
2) Initially, it was not provided that there are default pictures. For example, as in VK - there are camera.png pictures (when there are no avatars), there is deactivated.png (when a person is banned - "dog")
Now to the question:
1) The parser has been updated. Those. now if photo_ex contains a link to the default image - we don't download anything, but just immediately write the path to photo_local which also refers to the default image in the locale.
2) A script was written that will run through the database and look for these same default pictures - delete the picture locally and enter the path to the default picture in photo_local.
And the question actually is how to apply all this now without stopping the parser, etc.
Problems:
1) If you start a new parser right away - it will overwrite the path to photo_local and the picture that was there - it will no longer be possible to find it. And it needs to be deleted
2) If you run the deleter with the old working parser, the old parser will again load default pictures and overwrite photo_local
Answer the question
In order to leave comments, you need to log in
My options are:
1) Stop all parsers. Run the remover, which will do all the work. Then run a new parser
2) The new parser only overwrites new entries. And the deleter processes only raw ones.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question