Commit 808ad123 authored by Matija Čupić's avatar Matija Čupić

Log billing state changes in CheckGcpProjectBillingWorker

parent 02154350
...@@ -74,7 +74,20 @@ class CheckGcpProjectBillingWorker ...@@ -74,7 +74,20 @@ class CheckGcpProjectBillingWorker
) )
end end
def log_transition(previous_state, current_state)
state_message = if previous_state.nil? && !current_state
"no_billing"
elsif previous_state.nil? && current_state
"with_billing"
elsif !previous_state && current_state
"billing_configured"
end
Rails.logger.info "#{self.class}: state: #{state_message}"
end
def update_billing_change_counter(previous_state, current_state) def update_billing_change_counter(previous_state, current_state)
log_transition(previous_state, current_state)
return unless !previous_state && current_state return unless !previous_state && current_state
billing_changed_counter.increment billing_changed_counter.increment
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment