summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/workers/check_gcp_project_billing_worker.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/workers/check_gcp_project_billing_worker.rb b/app/workers/check_gcp_project_billing_worker.rb
index 1a2894f6268..624d515c6bc 100644
--- a/app/workers/check_gcp_project_billing_worker.rb
+++ b/app/workers/check_gcp_project_billing_worker.rb
@@ -74,7 +74,20 @@ class CheckGcpProjectBillingWorker
)
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)
+ log_transition(previous_state, current_state)
return unless !previous_state && current_state
billing_changed_counter.increment