mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 17:11:42 +00:00
fix: asumir que todos los sitios ya están indexados
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
074cb49752
commit
1e13985ef8
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue