Commit af31f711 authored by Qingyu Zhao's avatar Qingyu Zhao

Clean up unreachable code after tighten DB contraint

Not NULL contraint was applied to namespace_id column on
gitlab_subscriptions table, by merge request
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54319.
As a result, gitlab_subscription.namespace should always
present. We can safely remove the code where it checks
the `gitlab_subscription.namespace`'s presence.
parent b8592751
...@@ -16,14 +16,6 @@ class UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker # rubocop:disable Scalab ...@@ -16,14 +16,6 @@ class UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker # rubocop:disable Scalab
tuples = [] tuples = []
subscriptions.each do |subscription| subscriptions.each do |subscription|
# This should be removed after https://gitlab.com/gitlab-org/gitlab/-/issues/243496
# Because there should not be any NULL namespace_id gitlab_subscription after the merge
# request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40537
unless subscription.namespace
track_error(subscription)
next
end
subscription.refresh_seat_attributes! subscription.refresh_seat_attributes!
tuples << [subscription.id, subscription.max_seats_used, subscription.seats_in_use, subscription.seats_owed] tuples << [subscription.id, subscription.max_seats_used, subscription.seats_in_use, subscription.seats_owed]
......
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