Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 00:07:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 00:07:57 +0300
commit5aa96ff14229dba7e35f213354963febf3ad2833 (patch)
tree544f3233c05f7f1aa723ea9f13036f2f45d91745 /app/workers/namespaces
parent7ebcead8cfd2edb810dd0cbda816b6cfbd170fe3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/namespaces')
-rw-r--r--app/workers/namespaces/root_statistics_worker.rb8
-rw-r--r--app/workers/namespaces/schedule_aggregation_worker.rb8
2 files changed, 3 insertions, 13 deletions
diff --git a/app/workers/namespaces/root_statistics_worker.rb b/app/workers/namespaces/root_statistics_worker.rb
index 5fceeb8e03d..70b2510488b 100644
--- a/app/workers/namespaces/root_statistics_worker.rb
+++ b/app/workers/namespaces/root_statistics_worker.rb
@@ -16,13 +16,7 @@ module Namespaces
namespace.aggregation_schedule.destroy
rescue ::Namespaces::StatisticsRefresherService::RefresherError, ActiveRecord::RecordNotFound => ex
- log_error(namespace.full_path, ex.message) if namespace
- end
-
- private
-
- def log_error(namespace_path, error_message)
- Gitlab::SidekiqLogger.error("Namespace statistics can't be updated for #{namespace_path}: #{error_message}")
+ Gitlab::ErrorTracking.track_exception(ex, namespace_id: namespace_id, namespace: namespace&.full_path)
end
end
end
diff --git a/app/workers/namespaces/schedule_aggregation_worker.rb b/app/workers/namespaces/schedule_aggregation_worker.rb
index 60210e2f5a7..94343a9e378 100644
--- a/app/workers/namespaces/schedule_aggregation_worker.rb
+++ b/app/workers/namespaces/schedule_aggregation_worker.rb
@@ -16,8 +16,8 @@ module Namespaces
return if root_ancestor.aggregation_scheduled?
Namespace::AggregationSchedule.safe_find_or_create_by!(namespace_id: root_ancestor.id)
- rescue ActiveRecord::RecordNotFound
- log_error(namespace_id)
+ rescue ActiveRecord::RecordNotFound => ex
+ Gitlab::ErrorTracking.track_exception(ex, namespace_id: namespace_id)
end
private
@@ -34,9 +34,5 @@ module Namespaces
Namespace::AggregationSchedule.table_exists?
end
-
- def log_error(root_ancestor_id)
- Gitlab::SidekiqLogger.error("Namespace can't be scheduled for aggregation: #{root_ancestor_id} does not exist")
- end
end
end