2023-07-20 17:58:21 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-07-31 17:18:07 +00:00
|
|
|
# Permite traer los cambios desde webhooks
|
|
|
|
|
2023-07-20 17:58:21 +00:00
|
|
|
class GitPullJob < ApplicationJob
|
2023-09-27 19:46:33 +00:00
|
|
|
# @param :site [Site]
|
|
|
|
# @param :usuarie [Usuarie]
|
|
|
|
# @return [nil]
|
|
|
|
def perform(site, usuarie)
|
2024-04-12 18:31:47 +00:00
|
|
|
@site = site
|
|
|
|
|
2023-09-27 19:54:38 +00:00
|
|
|
return unless site.repository.origin
|
2023-09-27 19:46:33 +00:00
|
|
|
return unless site.repository.fetch.positive?
|
|
|
|
|
|
|
|
site.repository.merge(usuarie)
|
2023-09-27 19:47:00 +00:00
|
|
|
site.reindex_changes!
|
2023-09-27 19:46:33 +00:00
|
|
|
end
|
|
|
|
end
|