Skip to content

Commit

Permalink
Show a warn message when batch isn't supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Cantero committed Jan 10, 2017
1 parent 3dce8d3 commit 025fc83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/shoryuken/middleware/server/auto_extend_visibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ module Shoryuken
module Middleware
module Server
class AutoExtendVisibility
include Util

EXTEND_UPFRONT_SECONDS = 5

def call(worker, queue, sqs_msg, body)
if sqs_msg.is_a?(Array)
logger.warn { "Auto extend visibility isn't supported for batch workers" }
return yield
end

timer = auto_visibility_timer(worker, queue, sqs_msg, body)

begin
yield
ensure
Expand Down
5 changes: 5 additions & 0 deletions lib/shoryuken/middleware/server/exponential_backoff_retry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ class ExponentialBackoffRetry
include Util

def call(worker, queue, sqs_msg, body)
if sqs_msg.is_a?(Array)
logger.warn { "Exponential backoff isn't supported for batch workers" }
return yield
end

started_at = Time.now
yield
rescue
Expand Down

0 comments on commit 025fc83

Please sign in to comment.