1
0
Fork 0
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:
Mike Perham 2012-02-07 17:35:14 -08:00
parent aa9514cde0
commit cc1db52918
5 changed files with 17 additions and 2 deletions

View 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

View file

@ -0,0 +1 @@
Added <%= @count %> jobs!

View file

@ -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

View file

@ -34,4 +34,5 @@ Myapp::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
config.assets.logger = nil
end

View file

@ -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.