hotdog 0.18.1 → 0.18.2

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: 432e4c157ab55cac761f65c4b8540a24c8c7388b
4
- data.tar.gz: df40d3f8e390d743b09eae9baf04099bda6dd16a
3
+ metadata.gz: 41826771eee978718b934da22818cc2da5d0e3c6
4
+ data.tar.gz: abc210a02a3a1b571ec5013bbb4b62791221cecd
5
5
  SHA512:
6
- metadata.gz: bc50f93e59fa510030bb7831ed57c39c423bc65a3f5b986c924163a40cc9b8c05cefe8afd53832574339d76a97352639b0f97b3268f2a1bbf53ce8c175be8618
7
- data.tar.gz: 186079946620fdc200f16dabb4c76ec2c4ad44c8a1142086d1c8b66ffca5eb223cd422e111f4d2f418de9bb3c630714270d6350e0808b1f2a1856bf210880c8b
6
+ metadata.gz: a150d41cbbe3090ef6c8fc53fb03a183e9ddfdcf25ddc2056096adf3718b8830b8e4be3b25faeae658cdcfbd6d324f9b00c964c1ecf96d7dd02dfa19a734c9bf
7
+ data.tar.gz: b555bb6321256c117b764c2f65bcbc635dce11f6510554484e1ad3316098bdaa0d3089a345b29d31989332956570e41ed8967bd416c437b5d51399233e78f44d
@@ -41,9 +41,13 @@ module Hotdog
41
41
  }
42
42
  if 0 < hosts.length
43
43
  if open_db
44
- hosts.each_slice(SQLITE_LIMIT_COMPOUND_SELECT) do |hosts|
45
- execute_db(@db, "DELETE FROM hosts_tags WHERE host_id IN ( SELECT id FROM hosts WHERE name IN (%s) )" % hosts.map { "?" }.join(", "), hosts)
46
- execute_db(@db, "DELETE FROM hosts WHERE name IN (%s)" % hosts.map { "?" }.join(", "), hosts)
44
+ with_retry do
45
+ @db.transaction do
46
+ hosts.each_slice(SQLITE_LIMIT_COMPOUND_SELECT) do |hosts|
47
+ execute_db(@db, "DELETE FROM hosts_tags WHERE host_id IN ( SELECT id FROM hosts WHERE name IN (%s) )" % hosts.map { "?" }.join(", "), hosts)
48
+ execute_db(@db, "DELETE FROM hosts WHERE name IN (%s)" % hosts.map { "?" }.join(", "), hosts)
49
+ end
50
+ end
47
51
  end
48
52
  end
49
53
  end
@@ -38,9 +38,13 @@ module Hotdog
38
38
  end
39
39
  end
40
40
  if open_db
41
- create_tags(@db, options[:tags])
42
- options[:tags].each do |tag|
43
- associae_tag_hosts(@db, tag, hosts)
41
+ with_retry do
42
+ @db.transaction do
43
+ create_tags(@db, options[:tags])
44
+ options[:tags].each do |tag|
45
+ associae_tag_hosts(@db, tag, hosts)
46
+ end
47
+ end
44
48
  end
45
49
  end
46
50
  end
@@ -53,8 +53,12 @@ module Hotdog
53
53
  remove_db
54
54
  else
55
55
  if open_db
56
- options[:tags].each do |tag|
57
- disassociate_tag_hosts(@db, tag, hosts)
56
+ with_retry do
57
+ @db.transaction do
58
+ options[:tags].each do |tag|
59
+ disassociate_tag_hosts(@db, tag, hosts)
60
+ end
61
+ end
58
62
  end
59
63
  end
60
64
  end
@@ -1,3 +1,3 @@
1
1
  module Hotdog
2
- VERSION = "0.18.1"
2
+ VERSION = "0.18.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotdog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yamashita Yuu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-12 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -263,4 +263,3 @@ test_files:
263
263
  - spec/parser/regexp_expression_spec.rb
264
264
  - spec/parser/string_expression_spec.rb
265
265
  - spec/spec_helper.rb
266
- has_rdoc: