moose-inventory 1.0.5 → 1.0.7

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
  SHA1:
3
- metadata.gz: 97767bc15af5cacaf663c0d481bdf3bb3ce44945
4
- data.tar.gz: b78aee8bd6198832650adf9f6d396f0f8e104ec2
3
+ metadata.gz: aa64e991a9487d623df71257a5c1aaf59edda5b1
4
+ data.tar.gz: 94b5ae699178d9fdba732e31878899bb988fa15b
5
5
  SHA512:
6
- metadata.gz: f72e5c69616c5453b9a03282754ba78292e4c92e3f6e9293b9ab3bb62f99a6cc616bad2ed3701e568565e881eef47321d7dac15bfded5085210b677152f78366
7
- data.tar.gz: f8c1100975131c6646659b642efad9e579eef5984cf5c6bd4b886d609e08b6f78c0d21dba0340e81f8b0f41229bfcb3bb3554cdf077da194baa4943f22838c51
6
+ metadata.gz: 7d59d86537df3366dba60baff13c0656915bd42d6d17fd2bfe42080363c8aeef6dfba1e36deca4cdbf92fc59160b9f5d4a8afbb9d63f4ac17cd9ada2b2dc6bc3
7
+ data.tar.gz: 22d2c8eb12465e4c51f7aad80669b2173f6e86501739be2310339b4c0633e9d3b4ad90145faa37525b96c02303ecfe3f011af54afc135562b63208818b9ba85d
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ mkmf.log
17
17
  /coverage/
18
18
  *.gem
19
19
  /gems/
20
+ moose-inventory.spec
@@ -17,3 +17,4 @@ mkmf.log
17
17
  /coverage/
18
18
  *.gem
19
19
  /gems/
20
+ moose-inventory.spec
@@ -73,30 +73,31 @@ module Moose
73
73
  yield
74
74
  end
75
75
 
76
- rescue Sequel::DatabaseError => e
77
- # We want to rescue Sqlite3::BusyException. But, sequel catches that
78
- # and re-raises it as Sequel::DatabaseError, with a message referencing
79
- # the original exception class
80
-
81
- # We look into e, to see whether it is a BusyException. If not,
82
- # we re-raise immediately.
83
- raise unless e.message.include?("BusyException")
84
-
85
- # Looks like a BusyException, so we retrying, with a random stand-off.
86
- tries += 1
87
- case tries
88
- when 1..10
89
- if Moose::Inventory::Config._confopts[:trace] == true
90
- STDERR.puts e.message
91
- end
92
- warn('The database appears to be locked by another process. '\
93
- " This was try #{tries} of 10. "\
94
- ' Retrying after a pause of random duration.')
95
- sleep rand()
96
- retry
97
- else
98
- raise
76
+ rescue Sequel::DatabaseError => e
77
+ # We want to rescue Sqlite3::BusyException. But, sequel catches that
78
+ # and re-raises it as Sequel::DatabaseError, with a message referencing
79
+ # the original exception class
80
+
81
+ # We look into e, to see whether it is a BusyException. If not,
82
+ # we re-raise immediately.
83
+ raise unless e.message.include?("BusyException")
84
+
85
+ # Looks like a BusyException, so we retry, after a random delay.
86
+ tries += 1
87
+ case tries
88
+ when 1..10
89
+ if Moose::Inventory::Config._confopts[:trace] == true
90
+ STDERR.puts e.message
99
91
  end
92
+ sleep rand()
93
+ retry
94
+ else
95
+ warn('The database appears to be locked by another process, and '\
96
+ " did not become free after #{tries} tries. Giving up. ")
97
+
98
+ # TODO: Some useful advice to the user, as to what to do about this error.
99
+ raise
100
+ end
100
101
 
101
102
  rescue @exceptions[:moose] => e
102
103
  warn 'An error occurred during a transaction, any changes have been rolled back.'
@@ -2,6 +2,6 @@ module Moose
2
2
  ##
3
3
  # The Moose-Tools dynamic inventory management library
4
4
  module Inventory
5
- VERSION = '1.0.5'
5
+ VERSION = '1.0.7'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moose-inventory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Davies
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-30 00:00:00.000000000 Z
11
+ date: 2015-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: indentation