MushroomObserver / mushroom-observer

A website for sharing observations of mushrooms.
https://mushroomobserver.org
MIT License
77 stars 26 forks source link

Make `process_image` and `retransfer_images` scripts touch the obs when thumb image is transferred #2126

Closed nimmolo closed 2 months ago

nimmolo commented 2 months ago

We seem to have obs matrix_boxes that have been cached with a blank image. My working hypothesis is that the image was not done transferring to the image server at the moment where the cache was first created.

This PR changes the image transfer scripts to touch the obs when transfer is done, thereby invalidating the cache and forcing a new one. Hopefully that resolves the blank image issue.

TODO in a later PR: redo the image scripts as a queued job.

coveralls commented 2 months ago

Coverage Status

coverage: 94.446%. remained the same when pulling 8e95fb9cafcef83ed72d2190ec62a54dc7570fe6 on nimmo-touch-obs-on-image-transferred into 40c4cd3c32c28c1dc6a6da1e6bca28539bcedb30 on main.

nimmolo commented 2 months ago

Hm. On one of the CI tests (only push!), the obs actually seems to get touched by the image transfer script.

Progress: |========================================= FAIL ReportTest#test_darwin_observations (158.91s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -["1046914674", "https://mushroomobserver.org/1046914674", "HumanObservation", "2006-05-12 17:21:00 UTC", "MushroomObserver", nil, "Fungi", nil, "Kingdom", "Fungi", nil, nil, "Mary Newbie", "2006-05-11", "2006", "5", "11", "USA", "California", nil, "Burbank", "34.185", "-118.33", "148", "294", "Found in a strange place... & with śtrangè characters™"]
        +["1046914674", "https://mushroomobserver.org/1046914674", "HumanObservation", "2024-05-02 03:31:01 UTC", "MushroomObserver", nil, "Fungi", nil, "Kingdom", "Fungi", nil, nil, "Mary Newbie", "2006-05-11", "2006", "5", "11", "USA", "California", nil, "Burbank", "34.185", "-118.33", "148", "294", "Found in a strange place... & with śtrangè characters™"]

Changing the test to expect the fixture's current updated_at time, rather than the original updated_at, clears the error.

nimmolo commented 2 months ago

Oh i get it. The obs has been updated.