Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
S
Sidekiq Redis Experiments
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.com
GitLab Infrastructure Team
Sidekiq Redis Experiments
Commits
3b6695b1
Commit
3b6695b1
authored
3 years ago
by
Craig Miskell
Browse files
Options
Downloads
Patches
Plain Diff
Streamline worker generator
parent
b9d56760
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
create_worker_classes.rb
+1
-14
1 addition, 14 deletions
create_worker_classes.rb
with
1 addition
and
14 deletions
create_worker_classes.rb
+
1
−
14
View file @
3b6695b1
require
'yaml'
require
'fileutils'
class
String
def
camelize
(
first_letter
=
:upper
)
case
first_letter
when
:upper
ActiveSupport
::
Inflector
.
camelize
(
self
,
true
)
when
:lower
ActiveSupport
::
Inflector
.
camelize
(
self
,
false
)
else
raise
ArgumentError
,
"Invalid option, use either :upper or :lower."
end
end
end
require
'active_support/core_ext/string'
%w[app/workers/all_queues.yml ee/app/workers/all_queues.yml]
.
each
do
|
queues
|
ws
=
YAML
.
load_file
(
queues
)
...
...
@@ -28,7 +16,6 @@ ws.each do |w|
File
.
open
(
"/tmp/workers/
#{
file_parts
.
join
(
"/"
)
}
.rb"
,
"w"
)
do
|
f
|
classdef
=
<<-
CLASSDEF
class
#{
class_name
}
Worker
include Sidekiq::Worker
include ApplicationWorker
def perform(*args)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment