mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Update rails app to include smoke testing/demo functionality.
This commit is contained in:
parent
aa9514cde0
commit
cc1db52918
5 changed files with 17 additions and 2 deletions
9
myapp/app/controllers/work_controller.rb
Normal file
9
myapp/app/controllers/work_controller.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class WorkController < ApplicationController
|
||||
def index
|
||||
@count = rand(100)
|
||||
puts "Adding #{@count} jobs"
|
||||
@count.times do
|
||||
HardWorker.perform_async('bubba', 123)
|
||||
end
|
||||
end
|
||||
end
|
1
myapp/app/views/work/index.html.erb
Normal file
1
myapp/app/views/work/index.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
Added <%= @count %> jobs!
|
|
@ -1,6 +1,8 @@
|
|||
class HardWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform(name, count)
|
||||
sleep 0.01
|
||||
puts 'done'
|
||||
sleep 1
|
||||
print "#{Time.now}\n"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -34,4 +34,5 @@ Myapp::Application.configure do
|
|||
|
||||
# Expands the lines which load the assets
|
||||
config.assets.debug = true
|
||||
config.assets.logger = nil
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
Myapp::Application.routes.draw do
|
||||
get "work" => "work#index"
|
||||
|
||||
# The priority is based upon order of creation:
|
||||
# first created -> highest priority.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue