fourkites-sqspoller 0.1.12.23 → 0.1.12.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGEyNjA3MGFhMDNmNjc5ZmMyZDc0M2E4MjY1M2QxM2NlY2I4MTAyMA==
4
+ YjRhNmRkYjQ1NWUwZWNkNDY1MzNjNDMwYjkwMDY0MTdiNzY3NjFhNw==
5
5
  data.tar.gz: !binary |-
6
- NDNmZDM2ZjhjOWYzOWE5MjkxY2RmMGJiMWNkODUwMjY5MmEzOTY3Yw==
6
+ MjQ2NWYzYTJmNjRjMGYxMWJjOTU0MGU2NDEzZTE0NDY2NmE5MWY2OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzllYTE5MzI5OWIwNTZjMWU1MmYwOWFiMzgwYWU0MGU5ZTc4OWZjOWNmNWQ5
10
- MWExMzlhOGI5YmM3NDhkMWU4YjNlNWU2MmMxMGRkYTRlNjczYmExODQxMGVl
11
- MDVhMTU1MDEyYTlhMGUyOWMxZWU1ZjhiMmM2ZjZjOTMzMTlmZDM=
9
+ NDQxMGZjMTZiYzMyZWRmYzMwOTBhZTNhMDk0YWQ4NmRhZmIxNzM2YmY4ZjUw
10
+ YTc5MDE4NWE5ZDVkNzBjZDk1ZGQ5M2VlMTI1NmU5Y2JlODhjZGQ2MTA3NDMx
11
+ MTc5YzFmZmNmYjUzM2U2YTc5ZGYxMDBlMTYxYmExNGVkY2Y1NTQ=
12
12
  data.tar.gz: !binary |-
13
- ZDI1Mzg4Y2RhMTQyZDhjNmIyMzNmMjUxNzU4YzgyNTM1NTBmODBjNTE1YWI2
14
- ZDY5NmFmNzBiMjc1ODQzNWYwYzk5YjlhMzg3YmVjZDA4MjQ4OTE0NGE4NTll
15
- Njc2NzE1MzMxMzNkMmVmOTc5ZGNjZjJlYjM4N2M5YzE1NzA0ZDY=
13
+ NjE5NGE1OWExYmZlZmQ3YjY3ZTc2NzM2ZmJiZGQ3ZDE4ZGI3M2U1ZDAzMmUw
14
+ ZTdiMjEzNDllNjBmMzY2YjM1NjkxYWUxNWQ2N2ViMDc4NjNhNDJjZTNmMmE5
15
+ ZDdiMGMxY2UyMjYzNjhiYzliOTczZWM2ZjhhMjYyZjVlNzA1MTc=
@@ -22,28 +22,27 @@ module Sqspoller
22
22
  def process(queue_controller, message, queue_name)
23
23
  @semaphore.synchronize {
24
24
  @pending_schedule_tasks +=1
25
- if @connection_pool.queue_length + @pending_schedule_tasks >= @max_allowed_queue_size
25
+ if @pending_schedule_tasks >= @max_allowed_queue_size
26
26
  @logger.info "Entered wait state, connection_pool size reached max threshold, pending_schedule_tasks=#{@pending_schedule_tasks}"
27
- while @connection_pool.queue_length > @worker_thread_pool_size || @connection_pool.queue_length + @pending_schedule_tasks >= @max_allowed_queue_size
27
+ while @connection_pool.queue_length > @worker_thread_pool_size || @pending_schedule_tasks >= @max_allowed_queue_size
28
28
  sleep(0.01)
29
29
  end
30
30
  @logger.info "Exiting wait state, connection_pool size reached below worker_thread_pool_size, pending_schedule_tasks=#{@pending_schedule_tasks}"
31
31
  end
32
32
  }
33
- begin
34
- @logger.info "Scheduling worker task for message: #{message.message_id}"
33
+ @logger.info "Scheduling worker task for message: #{message.message_id}"
35
34
 
35
+ begin
36
36
  @connection_pool.post do
37
37
  begin
38
38
  @logger.info "Starting worker task for message: #{message.message_id}"
39
39
  @worker_task.process(message.body, message.message_id)
40
- @pending_schedule_tasks -= 1
41
40
  @logger.info "Finished worker task for message: #{message.message_id}"
42
41
  queue_controller.delete_message message.receipt_handle
43
42
  rescue Exception => e
44
- @pending_schedule_tasks -= 1
45
43
  @logger.info "Caught error for message: #{message}, error: #{e.message}, #{e.backtrace.join("\n")}"
46
44
  end
45
+ @pending_schedule_tasks -= 1
47
46
  end
48
47
  rescue Concurrent::RejectedExecutionError => e
49
48
  @pending_schedule_tasks -= 1
data/sqspoller.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'sqspoller/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "fourkites-sqspoller"
8
- spec.version = '0.1.12.23'
8
+ spec.version = '0.1.12.24'
9
9
  spec.authors = ["anshul-fk"]
10
10
  spec.email = ["anshul@fourkites.com"]
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fourkites-sqspoller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12.23
4
+ version: 0.1.12.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - anshul-fk