blueprint_config 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cec591307b09bd72ebe07601ae537938479fa70561e82127a468b7e0028e4df8
4
- data.tar.gz: 4ac393929bbf592a95e4196cbb195cd7d463e80f4ba6df4fce8c99b74967e330
3
+ metadata.gz: 6cd1d77adc1c5b0c6804976f701d7169aa95dde0fbb759223bf5f866d3dcb6ce
4
+ data.tar.gz: a2afa1abc74f9353444ee4a03c8afd256ba56521f5d914376f145367caa9b70b
5
5
  SHA512:
6
- metadata.gz: 17467c0fd7172bf30880be1a40c1564c7f4271df3f388537f31986682f950766cea2ef3969061d5e7e2f68b1935dcddc930bff9151815be09be6ffcc1cca6bc8
7
- data.tar.gz: 890305e747d5314fcd1d9fc13e0eeaec4d931930483ef39898f44df9105f17f5e4e191b5a1f76eb907bc00647668ceb42b2ded7dc6051c476e43fc37d458b200
6
+ metadata.gz: dcc11edd92aed918514ec06d6da8b8fe98033ceed743d8bb710d8263bcb93460ee089d6299c31a969d93cfe7997aab707b5d5749a6af99e4383a0870a2d64201
7
+ data.tar.gz: 3363d88bfbc0da672f308f4d528b256399a4ac0c5364e2a4c25f298e84bf951f41feab992c071d5f74f978df7695cd9fcb3c49998c83ceae705c9f7ed3e2f9f3
@@ -51,13 +51,18 @@ module BlueprintConfig
51
51
 
52
52
  def fresh?
53
53
  # if database is not create/configured yet - don't try to refresh settings from it
54
- return true if !@configured
54
+ return true unless @configured
55
55
  return true if @last_checked_at.present? && @last_checked_at > 1.second.ago
56
56
 
57
57
  @mutex.synchronize do
58
58
  @last_checked_at = Time.now
59
59
  end
60
- @updated_at.present? && @updated_at >= Setting.maximum(:updated_at)
60
+ max_updated_at = Setting.maximum(:updated_at)
61
+
62
+ # if there is no settings in the database - don't try to refresh settings from it'
63
+ return true if max_updated_at.blank?
64
+
65
+ @updated_at.present? && @updated_at >= max_updated_at
61
66
  end
62
67
  end
63
68
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlueprintConfig
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueprint_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Elchinov