soulheart 0.2.4 → 0.2.6

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: 6ea5dc27c836697c1fdbf001f73cbed523f68224
4
- data.tar.gz: 9cc198b63222b8bfbb9503178ce913996046526e
3
+ metadata.gz: df407f0c3c5f2585652ae42da30e5cbf7ad54827
4
+ data.tar.gz: 35b7e98e2772fa4b5674fa95fec7489df9ef87e2
5
5
  SHA512:
6
- metadata.gz: ba0fd796cc5a6d631936ca12b04583add3ff2f46e5cf5e711fe6b0606c8c191facf6d5c5e9aeb0dba34801cf9503c8eadfd39a1d878b2bbd563fc7f8a33b6825
7
- data.tar.gz: 18e922688690e0126b9e2722ee800677c2015366893b8b592ac07bacd1c2ae583473910a6cf510efd336dd05cba2984c08978cccdd7affe73e64f0658ae909ea
6
+ metadata.gz: 562d4597850ae2b2e9c83228427dffaaf9333db21a8923522826466eaac838d008fe08434382e804e0b0f1a7f5883234a29b84dff07ae1d47e1465a38f37c249
7
+ data.tar.gz: 45d6a5cec1d5feb44b666230905f068370f365dfdeca7f6a88d00eeb55548c3ba808b2bdfd1691ff2b74ec6ef38ede6955b6353a40d0e369798faafa5759c6b6
@@ -55,22 +55,19 @@ module Soulheart
55
55
  # everything will work itself out as soon as the cache expires again.
56
56
  end
57
57
 
58
- def remove_results_hash(cat_ids)
59
- # delete the data store
60
- # We don't do this every time we clear because because it breaks the caching feature.
61
- # The option to clear this is only called in testing right now.
62
- # There should be an option to clear it other times though.
63
- cat_ids.map { |cat_id| redis.expire(no_query_id(cat_id), 0) }
58
+ def clear_cache
59
+ # Remove the remove_results_hash
60
+ # has to be called before the cat_ids are cleared
61
+ category_combos.map { |cat| redis.expire(no_query_id(category_id(cat)), 0) }
64
62
  redis.expire results_hashes_id, 0
65
63
  redis.del(results_hashes_id)
66
64
  end
67
65
 
68
- def clear(remove_results=false)
69
- cat_ids = category_combos.map { |cat| category_id(cat) }
70
- cat_ids.each {|cat_id| delete_data(cat_id) }
66
+ def clear(should_clear_cache = false)
67
+ clear_cache if should_clear_cache
68
+ category_combos.each {|cat| delete_data(category_id(cat)) }
71
69
  delete_categories
72
70
  delete_data
73
- remove_results_hash(cat_ids) if remove_results
74
71
  end
75
72
 
76
73
  def load(items)
@@ -1,3 +1,3 @@
1
1
  module Soulheart
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soulheart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Herr