Closed pk5ls20 closed 9 months ago
Using the uuid5 directly will rewrite the old entry in database with the new entry directly, if two images have a same SHA1.
Yes, but if the SHA1 of both images is the same, we can assume that both images are the same, i.e. only necessary to index once
Maybe we should query the database before copying and inserting to make sure the images don't exist in the database?
In a sense, there will be no difference in the final database contents between the two, whether you query the database for the same id entry already existing before insertion or just insert it. But maybe the former will save indexing time?
I'll test the time difference between the two later
Due to considering the statefulness of the content in the payload, direct overwriting is not a good option, and the best way to do this is to perform appropriate checks to ensure that any data is not accidentally overwritten
@hv0905 I think this PR is now ready to be merged into master (:з」∠)
Using the uuid5 directly will rewrite the old entry in database with the new entry directly, if two images have a same SHA1.
Maybe we should query the database to make sure the image doesn't exist in the db before copying and inserting?