5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-05-17 05:10:49 +00:00

fix: asumir que todos los sitios ya están indexados
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
f 2023-09-27 16:31:23 -03:00
parent 074cb49752
commit 1e13985ef8
No known key found for this signature in database

View file

@ -2,7 +2,17 @@
# Almacenar el último commit indexado
class AddLastIndexedCommitToSites < ActiveRecord::Migration[6.1]
def change
def up
add_column :sites, :last_indexed_commit, :string, null: true
Site.find_each do |site|
site.update_columns(last_indexed_commit: site.repository.head_commit.oid)
rescue Rugged::Error, Rugged::OSError => e
puts "Falló #{site.name}, ignorando: #{e.message}"
end
end
def down
remove_column :sites, :last_indexed_commit
end
end