onebody-updateagent 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/updateagent/updateagent.rb +14 -1
  3. metadata +9 -9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 0.6.5
@@ -127,9 +127,22 @@ class UpdateAgent
127
127
  @errors = []
128
128
  puts 'Updating remote end...'
129
129
  index = 0
130
+ retries = 10
130
131
  print "#{resource.name} 0/0\r"; STDOUT.flush
131
132
  (@create + @update).each_slice(MAX_TO_BATCH_AT_A_TIME) do |records|
132
- response = resource.post(:batch, {}, {:options => @options['remote_options'], :records => records}.to_xml)
133
+ begin
134
+ xml = {:options => @options['remote_options'], :records => records}.to_xml
135
+ response = resource.post(:batch, {}, xml)
136
+ rescue ActiveResource::TimeoutError
137
+ retries -= 1
138
+ if retries > 0
139
+ puts "ActiveResource::TimeoutError with xml:\n#{xml}\n\nwill retry #{retries} more time(s) after 10 seconds..."
140
+ sleep 10
141
+ retry
142
+ else
143
+ raise
144
+ end
145
+ end
133
146
  statuses = Hash.from_xml(response.body)['objects']
134
147
  statuses.each do |status|
135
148
  record = data_by_id[status['legacy_id'].to_i]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onebody-updateagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-28 00:00:00.000000000Z
12
+ date: 2012-06-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fastercsv
16
- requirement: &17158100 !ruby/object:Gem::Requirement
16
+ requirement: &11282520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *17158100
24
+ version_requirements: *11282520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: highline
27
- requirement: &17157660 !ruby/object:Gem::Requirement
27
+ requirement: &11282040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *17157660
35
+ version_requirements: *11282040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activeresource
38
- requirement: &17157160 !ruby/object:Gem::Requirement
38
+ requirement: &11281400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 2.3.14
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *17157160
46
+ version_requirements: *11281400
47
47
  description:
48
48
  email: tim@timmorgan.org
49
49
  executables:
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 1.8.6
87
+ rubygems_version: 1.8.10
88
88
  signing_key:
89
89
  specification_version: 3
90
90
  summary: Companion to OneBody that handles sync with external data source.