mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 08:11:42 +00:00
ya existe un lugar donde guardar la configuración
This commit is contained in:
parent
10d950689b
commit
a0134cc052
3 changed files with 5 additions and 15 deletions
|
@ -1,14 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Configuración general de Sutty
|
||||
class Sutty
|
||||
extend self
|
||||
|
||||
# Los nodos son otros servidores de Sutty hacia los que se sincronizan
|
||||
# sitios.
|
||||
#
|
||||
# @return [Array]
|
||||
def nodes
|
||||
@nodes ||= ENV.fetch('SUTTY_NODES', '').split(',')
|
||||
end
|
||||
end
|
|
@ -148,7 +148,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
|||
|
||||
# Crea los deploys necesarios para sincronizar a otros nodos de Sutty
|
||||
def sync_nodes
|
||||
Sutty.nodes.each do |node|
|
||||
Rails.application.nodes.each do |node|
|
||||
site.deploys.build(type: 'DeployRsync', destination: "sutty@#{node}:#{site.hostname}")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -49,5 +49,9 @@ module Sutty
|
|||
EmailAddress::Config.error_messages translations.transform_keys(&:to_s), locale.to_s
|
||||
end
|
||||
end
|
||||
|
||||
def nodes
|
||||
@nodes ||= ENV.fetch('SUTTY_NODES', '').split(',')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue