• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

payrollhero / dispatch-rider / #3015

02 Sep 2022 11:22PM UTC coverage: 0.409% (-84.7%) from 85.154%
#3015

push

web-flow
Layout/SpaceInsideStringInterpolation-20220901233630 (#89)

* :police_car: regenerate rubocop todo

* :police_car: Layout/SpaceInsideStringInterpolation

* :police_car: regenerate rubocop todo

Co-authored-by: Rubocop Challenger <rubocop@payrollhero.com>

0 of 1 new or added line in 1 file covered. (0.0%)

1529 existing lines in 63 files now uncovered.

7 of 1711 relevant lines covered (0.41%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/dispatch-rider/queue_services/aws_sqs/sqs_received_message.rb
UNCOV
1
module DispatchRider
×
UNCOV
2
  module QueueServices
×
UNCOV
3
    class AwsSqs < Base
×
UNCOV
4
      class SqsReceivedMessage < ReceivedMessage
×
UNCOV
5
        attr_reader :total_timeout, :start_time
×
6

UNCOV
7
        def initialize(message, raw_item, queue, queue_visibility_timeout)
×
UNCOV
8
          @queue = queue
×
UNCOV
9
          @total_timeout = queue_visibility_timeout.to_i
×
UNCOV
10
          @start_time = Time.now
×
UNCOV
11
          super(message, raw_item)
×
UNCOV
12
        end
×
13

14
        # NOTE: Setting the visibility timeout resets the timeout to NOW and makes it visibility timeout this time
15
        # Essentially resetting the timer on this message
UNCOV
16
        def extend_timeout(timeout)
×
UNCOV
17
          item.visibility_timeout = timeout
×
UNCOV
18
          if timeout > 0
×
UNCOV
19
            @total_timeout = timeout + (Time.now - start_time).to_i
×
UNCOV
20
          end
×
UNCOV
21
        end
×
22

23
        # We effectively return the item to the queue by setting
24
        # the visibility timeout to zero.  The item
25
        # should become immediately visible.
26
        # The next receiver will reset the visibility
27
        # to something appropriate
UNCOV
28
        def return_to_queue
×
UNCOV
29
          extend_timeout(0)
×
UNCOV
30
        end
×
31

UNCOV
32
        def receive_count
×
33
          @item.approximate_receive_count
×
UNCOV
34
        end
×
35

UNCOV
36
        def sent_at
×
37
          @item.sent_timestamp
×
UNCOV
38
        end
×
39

UNCOV
40
        def queue_name
×
41
          @item.queue_arn.split(':').last
×
UNCOV
42
        end
×
UNCOV
43
      end
×
UNCOV
44
    end
×
UNCOV
45
  end
×
UNCOV
46
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc