influxer 1.2.1 → 1.2.2

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fa8f3e80a1c44d03d2217577611586d49e346fef552cc7545a73b39d6824a95
4
- data.tar.gz: 990ebe156e20a28189949ad6d428188bc498cd70dd53614e777c28317609ed7e
3
+ metadata.gz: cee4a4e35b41eda0936d8f7344a2a06d1dc251a0c9a7303723413f1c3a702d25
4
+ data.tar.gz: 8d027da03e9bae2a76351f1cdd0a21f7f5ccf32eb73282fac95a09fbd8771aad
5
5
  SHA512:
6
- metadata.gz: fa4793fba2f7a21533ef25a18d44ea2e525878a0d5d23cdb94b87287c001b4b776e01c2aa2bd5a8ecc35fb18ec2e1841172f94bb3071f61ea00b1a5e820612d4
7
- data.tar.gz: '09d22a2c32a82775c39503545197becfd5eda67bdd18251274770dd9e6681d06e6efd13aa84a62e08a406c8fa51b95398efdf74fb5cd2720f40751a404730258'
6
+ metadata.gz: 34fab113906dfeb113cff12cc6bfb0654891502d8ee8382717a1cae7b90d484cdf2933d283a9497a9fd2c2b946ad77f647c0096822d5c61f41368f21fd898f68
7
+ data.tar.gz: 8c30816022d49e8aa74db8945fc9f7bcd5cf73334cf92f886d469f6cc6ca7b11bbe855a876a17bd3898b2db434c2e5b29712606b5c5685ed1bb93e0982e959f6
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 1.2.2 (2020-10-27)
6
+
7
+ - Fixes [#49](https://github.com/palkan/influxer/issues/49) Cache hash configuration cannot be applied.([@AlexanderShvaykin][])
8
+ - Fixes [#47](https://github.com/palkan/influxer/issues/47) Can't delete data when retention policy is set for a metric. ([@MPursche][])
9
+
5
10
  ## 1.2.1 (2020-07-09)
6
11
 
7
12
  - Support for setting timezone in queries to configure influx time calculations, e.g., time epoch aggregation ([@jklimke][])
@@ -90,3 +95,4 @@ See [changelog](https://github.com/palkan/influxer/blob/1.0.0/Changelog.md) for
90
95
  [@MPursche]: https://github.com/MPursche
91
96
  [@jklimke]: https://github.com/jklimke
92
97
  [@dimiii]: https://github.com/dimiii
98
+ [@AlexanderShvaykin]: https://github.com/AlexanderShvaykin
@@ -28,15 +28,28 @@ module Influxer
28
28
  :denormalize,
29
29
  :udp,
30
30
  :async,
31
+ :cache_enabled,
32
+ :cache,
31
33
  database: "db",
32
34
  time_precision: "ns",
33
- cache: false,
34
35
  time_duration_suffix_enabled: false
35
36
 
36
37
  def load(*)
37
38
  super
38
- # we want pass @cache value as options to cache store, so we want it to be a Hash
39
- @cache = {}.with_indifferent_access if @cache == true
39
+ if cache_enabled.nil?
40
+ self.cache_enabled = cache_enabled_value
41
+ end
42
+ end
43
+
44
+ def cache=(value)
45
+ super
46
+ self.cache_enabled = cache_enabled_value
47
+ end
48
+
49
+ private
50
+
51
+ def cache_enabled_value
52
+ !!cache
40
53
  end
41
54
  end
42
55
  end
@@ -219,7 +219,7 @@ module Influxer
219
219
  ["drop series"]
220
220
  end
221
221
 
222
- sql << "from #{@instance.series}"
222
+ sql << "from #{@instance.series(write: true)}"
223
223
 
224
224
  sql << "where #{where_values.join(" and ")}" unless where_values.empty?
225
225
 
@@ -6,10 +6,10 @@ module Influxer
6
6
  class Client
7
7
  def query(sql, options = {})
8
8
  log_sql(sql) do
9
- if !options.fetch(:cache, true) || Influxer.config.cache == false
10
- super(sql, options)
9
+ if !(options.fetch(:cache, true) && Influxer.config.cache_enabled)
10
+ super(sql, **options)
11
11
  else
12
- Rails.cache.fetch(normalized_cache_key(sql), cache_options(sql)) { super(sql, options) }
12
+ Rails.cache.fetch(normalized_cache_key(sql), **cache_options(sql)) { super(sql, **options) }
13
13
  end
14
14
  end
15
15
  end
@@ -34,7 +34,7 @@ module Influxer
34
34
  def cache_options(sql = nil)
35
35
  options = Influxer.config.cache.dup
36
36
  options[:expires_in] = (options[:cache_now_for] || 60) if /\snow\(\)/.match?(sql)
37
- options
37
+ options.symbolize_keys
38
38
  end
39
39
 
40
40
  # add prefix; remove whitespaces
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Influxer # :nodoc:
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Dem
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-09 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel