Skip to content

Commit

Permalink
Make process_image and retransfer_images touch the obs when thumb ima…
Browse files Browse the repository at this point in the history
…ge is transferred
  • Loading branch information
nimmolo committed May 2, 2024
1 parent 40c4cd3 commit 825a3b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions script/process_image
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ fi

if (( !$development && !$errors && $transferred_any )); then
log_mysql "UPDATE images SET transferred=TRUE WHERE id=$id"
log_mysql "UPDATE observations, observation_images SET observations.updated_at = NOW() WHERE observation_images.image_id = $id AND observation_images.observation_id = observations.id"
fi

if (( !$development && $errors )); then
Expand Down
3 changes: 2 additions & 1 deletion script/retransfer_images
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ for id in $ids; do
done
done

run_mysql "UPDATE images SET transferred=TRUE WHERE id=$id" || \
run_mysql "UPDATE images SET transferred=TRUE WHERE id=$id" &&
run_mysql "UPDATE observations, observation_images SET observations.updated_at = NOW() WHERE observation_images.image_id = $id AND observation_images.observation_id = observations.id" || \
die "Failed to set transferred bit on $id."
done

Expand Down

0 comments on commit 825a3b4

Please sign in to comment.