diff options
Diffstat (limited to 'app/workers/namespaces')
-rw-r--r-- | app/workers/namespaces/root_statistics_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/namespaces/schedule_aggregation_worker.rb | 8 |
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 |