blackstack_commons 1.1.19 → 1.1.20

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/functions.rb +11 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d51fd13ba00ed9f54bda8d4a372257f8cbc9f58b
4
- data.tar.gz: d9af32eb424f6f1865bb56ed74792ec95848efaa
3
+ metadata.gz: b41be51c4ae04da7529f5ef2cfcf6b89addf4236
4
+ data.tar.gz: 5600d485e1834ad752d417235514128130cf1743
5
5
  SHA512:
6
- metadata.gz: b5288b1620883ee73240aea2636a61f47426a07c8dd026d64f9bcd35ee71b6d70d1c9a3cae457d340d61963a93c5776d4b85bcb540ccf5043eb05580454ae6f7
7
- data.tar.gz: 2ec2a5da7afe4eb951b40b3b0593a5c2c5b67cdf84a64649f47e839fb56bb04da31d3ba62a2d9b43551302c28dfa97b05bcf5edd1b3e2738fb8f54f81bdfdc04
6
+ metadata.gz: 5b3abb0f802c4e35bfdc9afbd797dc70d2282adc0af43c366f3ae42242fc6ce1ab8158f2ee055952eebab19517ad0d6f82a7850568db4fd37fc65553a1bbb275
7
+ data.tar.gz: 230af29c06076101b23ddb372a3c8dffcbd0ab7e2c13b1f1d7b7a8f11c2baed9a9e83a8b259bca9ab2227b040453f4e7c03b016f8a5a76fc0f1118eb1ac2d624
data/lib/functions.rb CHANGED
@@ -508,9 +508,12 @@ module BlackStack
508
508
  # TODO: setup max_simultaneus_calls in the configurtion file.
509
509
  def self.call_post(url, params = {}, ssl_verify_mode=BlackStack::Netting::DEFAULT_SSL_VERIFY_MODE, use_lockfile=true)
510
510
  # build the lockfile name
511
+ puts ''
512
+ puts "call_post.url:#{url}:."
511
513
  x = 0
512
514
 
513
515
  if BlackStack::Netting.max_api_call_channels.to_i > 0
516
+ puts "call_post.url.1:."
514
517
  raise "Max Channels cannot be higher than #{BlackStack::Netting.lockfiles.size.to_s}" if BlackStack::Netting.max_api_call_channels > BlackStack::Netting.lockfiles.size
515
518
  x = rand(BlackStack::Netting.max_api_call_channels)
516
519
  # lock the file
@@ -518,7 +521,7 @@ module BlackStack
518
521
  end
519
522
 
520
523
  begin
521
-
524
+ puts "call_post.url.2:."
522
525
  # do the call
523
526
  uri = URI(url)
524
527
  ret = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :verify_mode => ssl_verify_mode) do |http|
@@ -534,20 +537,24 @@ module BlackStack
534
537
  res.error!
535
538
  end
536
539
  end
537
-
540
+ puts "call_post.url.3:."
538
541
  # release the file
539
542
  BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
543
+ puts "call_post.url.4:."
540
544
  rescue => e
541
545
  # release the file
546
+ puts "call_post.url.5:."
542
547
  BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
543
-
548
+ puts "call_post.url.6:."
544
549
  # elevo la excepcion
545
550
  raise e
546
551
  ensure
547
552
  # release the file
553
+ puts "call_post.url.7:."
548
554
  BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
555
+ puts "call_post.url.8:."
549
556
  end
550
-
557
+ puts "call_post.url.9:."
551
558
  # return
552
559
  ret
553
560
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackstack_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.19
4
+ version: 1.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-28 00:00:00.000000000 Z
11
+ date: 2020-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: content_spinning