Skip to content

Commit

Permalink
Updated the echo worker to raise an error 15% of the time, so that we…
Browse files Browse the repository at this point in the history
… can test errors out on the web server.
  • Loading branch information
dbalatero committed Jun 10, 2009
1 parent a8b523c commit 479e699
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/simple_mock_worker/echo_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

class EchoWorker < QueueStick::MockWorker
def process(message)
puts message
sleep 2
if rand < 0.15
# 15% chance of raising an error!
raise ArgumentError, "We got an error processing this message!"
else
puts message
sleep 2
end
end

def recover
Expand Down

0 comments on commit 479e699

Please sign in to comment.