diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-02-08 17:21:34 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-12 21:32:55 +0100 |
commit | 808ad1231c590efed642809cba6d155d8767d69a (patch) | |
tree | ccc5927fddf1f424a414b017cf6c8e74c000c7cc | |
parent | 0215435058ea9f9ebcc1b793425fccd22317e651 (diff) | |
download | gitlab-ce-808ad1231c590efed642809cba6d155d8767d69a.tar.gz |
Log billing state changes in CheckGcpProjectBillingWorker
-rw-r--r-- | app/workers/check_gcp_project_billing_worker.rb | 13 |
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 |