Aggiunge i tornei con hub, pagina pubblica e tabellone per semifinali e finali.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -71,6 +71,10 @@ module Streams
|
||||
estimated_monthly_eur(overflow_count) <= monthly_budget_eur
|
||||
end
|
||||
|
||||
def quiet_hours?
|
||||
QuietHours.active?
|
||||
end
|
||||
|
||||
def reconcile!(provisioner: nil)
|
||||
return Result.new(skipped: true, actions: [], metrics: metrics) unless enabled?
|
||||
|
||||
@@ -106,7 +110,8 @@ module Streams
|
||||
allow_cloud: allow_cloud?,
|
||||
estimated_monthly_eur: estimated_monthly_eur(overflow.size),
|
||||
monthly_budget_eur: monthly_budget_eur,
|
||||
within_budget: within_budget?(overflow.size)
|
||||
within_budget: within_budget?(overflow.size),
|
||||
quiet_hours: quiet_hours?
|
||||
}
|
||||
end
|
||||
|
||||
@@ -201,6 +206,7 @@ module Streams
|
||||
end
|
||||
|
||||
def warm_spare_desired?(m)
|
||||
return false if self.class.quiet_hours?
|
||||
return false if self.class.warm_spare_min <= 0
|
||||
|
||||
need_capacity?(m) || overflow_in_use?
|
||||
@@ -211,6 +217,7 @@ module Streams
|
||||
end
|
||||
|
||||
def can_provision?(m)
|
||||
return false if self.class.quiet_hours?
|
||||
return false if m[:overflow_nodes] >= self.class.max_overflow_nodes
|
||||
return false unless self.class.within_budget?(m[:overflow_nodes] + 1)
|
||||
return false if self.class.kind == "cloud" && !self.class.allow_cloud?
|
||||
@@ -249,6 +256,9 @@ module Streams
|
||||
end
|
||||
|
||||
def idle_long_enough?(node)
|
||||
# Di notte chiudi subito i nodi idle (niente attesa IDLE_MINUTES).
|
||||
return true if self.class.quiet_hours?
|
||||
|
||||
idle_since(node) <= self.class.idle_minutes.minutes.ago
|
||||
end
|
||||
|
||||
@@ -258,6 +268,7 @@ module Streams
|
||||
end
|
||||
|
||||
def keep_as_warm_spare?(node)
|
||||
return false if self.class.quiet_hours?
|
||||
return false unless warm_spare_desired?(self.class.metrics)
|
||||
|
||||
spares = StreamNode.ready.where.not(slug: NodeRegistry::HOME_SLUG).select { |n| n.active_publishers.zero? }
|
||||
|
||||
Reference in New Issue
Block a user