gh-archive 0.15 → 0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gh-archive.rb +5 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de82207e7b0f5588a694e22b9d94c8e15e6812e8ad2dd433a8c78080c3629253
4
- data.tar.gz: 7bc6e39cb4834922e29764744a3a753d8cea34052b44b282126b520b36f69d64
3
+ metadata.gz: 1f339fca5ebd3f7ee085fa257b47567993ab776efd3ba143e424a6bab2ca1712
4
+ data.tar.gz: bd3709e9067fbc5ba0a7b92f156c3fa6f87d26bc81b0a969f7020526f31b5264
5
5
  SHA512:
6
- metadata.gz: 1acd0b50fdba7cf5944e50670817ad41879ea273b27c79d87d6463b0bc438220b9a806aba2db879b4dbe8394439f24a66ec9bace2a466f51fbb44755eefd6d99
7
- data.tar.gz: a30a6de0c073840eff54b7f0678bd996a794194d2a19ae35db1559b7d8ff4ec4f29591f36a6f114878d4737d29406ba919f8907b6706afb2f7b6ab7e8bcd4c26
6
+ metadata.gz: 9d56ecf4dc4101cf162d02e49f62dc77592bc652b9933b7413cb40f56eb25c595a20eed8fbc42e1f96830048d16520299972094b0d29b14f400befc5c21e1672
7
+ data.tar.gz: 5a7e8c158271b1b540e76e1b68f93ece7cebed8d29057728c6ac93b536f3f3417b89fffddcbe57c80e75269cda9ff719fef84e5bb0558dd52fd8842f80e44f55
data/lib/gh-archive.rb CHANGED
@@ -318,9 +318,10 @@ class OnlineGHAProvider < GHAProvider
318
318
  while @cache.full?
319
319
  sleep 1
320
320
  end
321
+
322
+ filename = self.get_gha_filename(current_time)
321
323
  @max_retries.times do
322
324
  begin
323
- filename = self.get_gha_filename(current_time)
324
325
  URI.open("http://data.gharchive.org/#{filename}") do |gz|
325
326
  content = self.read_gha_file(gz)
326
327
  @cache.put(filename, content)
@@ -394,7 +395,9 @@ class OnlineGHAProvider < GHAProvider
394
395
  end
395
396
 
396
397
  def has?(name)
397
- return @cache.has_key?(name)
398
+ @mutex.synchronize do
399
+ return @cache.has_key?(name)
400
+ end
398
401
  end
399
402
 
400
403
  def full?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.15'
4
+ version: '0.16'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Scalabrino