mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
site archiving: update timestamp when ipfs hash already exists
This commit is contained in:
parent
5c2f56e0b6
commit
ffb67cd3a8
1 changed files with 6 additions and 1 deletions
|
@ -732,7 +732,12 @@ class Site < Sequel::Model
|
|||
archive.updated_at = Time.now
|
||||
archive.save_changes
|
||||
else
|
||||
add_archive ipfs_hash: ipfs_hash, updated_at: Time.now
|
||||
begin
|
||||
add_archive ipfs_hash: ipfs_hash, updated_at: Time.now
|
||||
rescue Sequel::UniqueConstraintViolation
|
||||
# Record already exists, update timestamp
|
||||
archives_dataset.where(ipfs_hash: ipfs_hash).first.update updated_at: Time.now
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue