dbhero 1.1.11 → 1.1.12

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
  SHA1:
3
- metadata.gz: cf312387ab3cc656f871f0efa610f5b2dc1909fc
4
- data.tar.gz: afae91af4e2cd99d29e7d9964a263eca62938448
3
+ metadata.gz: 3d683bb2ba0fb505e053174760b64fc4093874bb
4
+ data.tar.gz: 89d42589918669d86fcb8f5e331bd21377a3889d
5
5
  SHA512:
6
- metadata.gz: 9fe841fff7b2a7835842eee2420d1e1b6a161b3c8d412ed8d9d562f31d4534e7f7baab1c040995cb55df75c0d291f6d0cb94afd80f8c177ae9c37dc624b6305b
7
- data.tar.gz: 4dfe9699d5905fcc5d9517c6df52f6488011b90613acc9bea9e6e3492a335788a8115e15d8307f6c25951e2928b29dc1e14465c07a8d242a47dde0fdecb78e80
6
+ metadata.gz: fd5e607b7772706fe2ed9364696cf6f14d043283ecf08f56a6fed3035ea6b8ffed444a702e24683679304f13f5e1506a2fa328f282649d0b1861e6b5494929b4
7
+ data.tar.gz: 07340c5ebc112a724d5cb92def74e20d304ec018f486bff71db03fc25b61c8afc06f56d6311a657daa43d1faad38b3bff0d663cc599db60bc3932d4b30858103
@@ -43,7 +43,7 @@ module Dbhero
43
43
  def query_result
44
44
  DataclipRead.transaction do
45
45
  begin
46
- @q_result ||= Rails.cache.fetch("dataclip_#{self.token}") do
46
+ @q_result ||= Rails.cache.fetch("dataclip_#{self.token}", expires_in: (::Dbhero.cached_query_exp||10.minutes)) do
47
47
  DataclipRead.connection.select_all(self.raw_query)
48
48
  end
49
49
  rescue => e
@@ -1,7 +1,7 @@
1
1
  module Dbhero
2
2
  module Configuration
3
3
  VALID_CONFIG_KEYS = [:authenticate, :current_user_method, :custom_user_auth_condition, :csv_delimiter,
4
- :user_representation, :google_api_id, :google_api_secret, :max_rows_limit].freeze
4
+ :user_representation, :google_api_id, :google_api_secret, :max_rows_limit, :cached_query_exp].freeze
5
5
 
6
6
  DEFAULT_AUTHENTICATE = true
7
7
  DEFAULT_CURRENT_USER_METHOD = :current_user
@@ -11,6 +11,7 @@ module Dbhero
11
11
  DEFAULT_CUSTOM_USER_AUTH_CONDITION = nil
12
12
  DEFAULT_MAX_ROWS_LIMIT = 10_000
13
13
  DEFAULT_CSV_DELIMITER = ','
14
+ DEFAULT_CACHED_QUERY_EXP = 10.minutes
14
15
 
15
16
  attr_accessor *VALID_CONFIG_KEYS
16
17
 
@@ -35,6 +36,7 @@ module Dbhero
35
36
  self.custom_user_auth_condition = DEFAULT_CUSTOM_USER_AUTH_CONDITION
36
37
  self.max_rows_limit = DEFAULT_MAX_ROWS_LIMIT
37
38
  self.csv_delimiter = DEFAULT_CSV_DELIMITER
39
+ self.cached_query_exp = DEFAULT_CACHED_QUERY_EXP
38
40
  end
39
41
 
40
42
  end
@@ -1,3 +1,3 @@
1
1
  module Dbhero
2
- VERSION = "1.1.11"
2
+ VERSION = "1.1.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbhero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antônio Roberto Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-01 00:00:00.000000000 Z
11
+ date: 2016-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails