Skip to content
Snippets Groups Projects
Commit d7729955 authored by Bob Van Landuyt's avatar Bob Van Landuyt Committed by Alessio Caiazza
Browse files

Explain cron-workers that don't need context

These workers don't need context because they don't operate scoped to
a user, namespace or project.
parent dd5500f1
No related branches found
No related tags found
1 merge request!158514Fix CodeReviewMetrics worker failure with kwargs
Showing
with 82 additions and 20 deletions
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
class AdminEmailWorker class AdminEmailWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category_not_owned! feature_category_not_owned!
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
class ExpireBuildArtifactsWorker class ExpireBuildArtifactsWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :continuous_integration feature_category :continuous_integration
......
...@@ -4,7 +4,10 @@ class GitlabUsagePingWorker ...@@ -4,7 +4,10 @@ class GitlabUsagePingWorker
LEASE_TIMEOUT = 86400 LEASE_TIMEOUT = 86400
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category_not_owned! feature_category_not_owned!
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
class ImportExportProjectCleanupWorker class ImportExportProjectCleanupWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :importers feature_category :importers
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
class PruneOldEventsWorker class PruneOldEventsWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category_not_owned! feature_category_not_owned!
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
# table. # table.
class PruneWebHookLogsWorker class PruneWebHookLogsWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :integrations feature_category :integrations
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
class RemoveUnreferencedLfsObjectsWorker class RemoveUnreferencedLfsObjectsWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :git_lfs feature_category :git_lfs
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
class RepositoryArchiveCacheWorker class RepositoryArchiveCacheWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :source_code_management feature_category :source_code_management
......
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
module RepositoryCheck module RepositoryCheck
class DispatchWorker class DispatchWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
include ::EachShardWorker include ::EachShardWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
class RequestsProfilesWorker class RequestsProfilesWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :source_code_management feature_category :source_code_management
......
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
class StuckImportJobsWorker class StuckImportJobsWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker updates several import states inline and does not schedule
# other jobs. So no context needed
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :importers feature_category :importers
worker_resource_boundary :cpu worker_resource_boundary :cpu
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
class TrendingProjectsWorker class TrendingProjectsWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :source_code_management feature_category :source_code_management
......
...@@ -4,8 +4,11 @@ class ClearSharedRunnersMinutesWorker ...@@ -4,8 +4,11 @@ class ClearSharedRunnersMinutesWorker
LEASE_TIMEOUT = 3600 LEASE_TIMEOUT = 3600
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
# all queries are scoped across multiple namespaces
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :continuous_integration feature_category :continuous_integration
def perform def perform
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
module Geo module Geo
class ContainerRepositorySyncDispatchWorker < Geo::Scheduler::Secondary::SchedulerWorker class ContainerRepositorySyncDispatchWorker < Geo::Scheduler::Secondary::SchedulerWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
def perform def perform
unless Gitlab.config.geo.registry_replication.enabled unless Gitlab.config.geo.registry_replication.enabled
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
module Geo module Geo
class FileDownloadDispatchWorker < Geo::Scheduler::Secondary::SchedulerWorker class FileDownloadDispatchWorker < Geo::Scheduler::Secondary::SchedulerWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
private private
......
...@@ -4,7 +4,10 @@ module Geo ...@@ -4,7 +4,10 @@ module Geo
class MetricsUpdateWorker class MetricsUpdateWorker
include ApplicationWorker include ApplicationWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :geo_replication feature_category :geo_replication
......
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
module Geo module Geo
class PruneEventLogWorker class PruneEventLogWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
include ::Gitlab::Utils::StrongMemoize include ::Gitlab::Utils::StrongMemoize
include ::Gitlab::Geo::LogHelpers include ::Gitlab::Geo::LogHelpers
......
...@@ -4,7 +4,10 @@ module Geo ...@@ -4,7 +4,10 @@ module Geo
module RepositoryVerification module RepositoryVerification
module Secondary module Secondary
class ShardWorker < Geo::Scheduler::Secondary::SchedulerWorker class ShardWorker < Geo::Scheduler::Secondary::SchedulerWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
attr_accessor :shard_name attr_accessor :shard_name
def perform(shard_name) def perform(shard_name)
......
...@@ -4,7 +4,10 @@ module Geo ...@@ -4,7 +4,10 @@ module Geo
module Scheduler module Scheduler
class PerShardSchedulerWorker class PerShardSchedulerWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
include ::Gitlab::Geo::LogHelpers include ::Gitlab::Geo::LogHelpers
include ::EachShardWorker include ::EachShardWorker
......
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
module Geo module Geo
class SidekiqCronConfigWorker class SidekiqCronConfigWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category :geo_replication feature_category :geo_replication
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment