docker-registry-sync 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTE2MzA1NjZmNTUzYWUzY2M3ZmEyNDM0N2RjODZlMDVjMDkyZTI2MA==
4
+ MTFmYmM3YTUyNzBlZWU1NTYzNWJmOTlkMWM3MmE4NGFmYzQzMTcxYw==
5
5
  data.tar.gz: !binary |-
6
- ZDA3NTIyMmY5MzBmYjYxNDc2ZmFjN2Q5NmZlMWVkZThkMGY2MTJkOA==
6
+ ZTA1MjY5Mjk4ZDRmY2FjNzllNDhiZmI2ZWQwMGU3OWU5MDM5NzZhYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzQzZmM4YzkyODliNTE2OGUzNjliYzQwNGZhNWI2ZTgwMDAwM2M3ZDZiMzhi
10
- ZTdiZTk2NTc3YTg3NzI3Nzg5YTk3NzAzNzFhYTI3YzUxMTAzOTg5NmM2NTJm
11
- NzkxN2JkYmZjNDUxMzcxYTc2ODU5Y2E4NGIwZmMzMTJlOTExMDg=
9
+ Njk5YmU1MTY0MDFiMzMwNjU2NDI5ZWQzM2I2Mzc4YmIxNWQ2ODE4NDRmYTc1
10
+ NWI1NDk2YmYyMTI4OGZjZDAwMWJhMTkzYWQ4ZTYwZmEwMWRiZDE1MzBiNjNm
11
+ MzAwMThkN2NjNjViZDE1MTM3ZGEwNDJjYjdkNjRlZTE3M2U5YzA=
12
12
  data.tar.gz: !binary |-
13
- M2EyNGM3ZjE1M2ExOWYzZWVkMWY1MzU4YjQ4NDY2MzYwN2E5N2EzNDg4ZGEx
14
- MjkxZDUyOGU0ZTM3OGE0MzRiM2QyNTJiMTU0MTc1YTUzMDEwMWQ2NWVmMzgx
15
- M2YxNjE5M2QyZDMwNTY4MDFhYmZmMmQ0ZTRmZDcyMjc4NzdhYmE=
13
+ NDViMDc2MjA2NmE3NzJkYzhiOTFlZmVlYTUyMWViZGY2NzBlZTQ1NjE2MWM2
14
+ Nzc3ZWZjZjFmNDk4ZWI3YWUzOWE0NGZhNmUwZTlhNDI2OWYxMTJhNzUxY2M3
15
+ MGQwZDM1Mzg3ZDI4OWE4NmIxNGQyY2FiYWZiZTRhZjZkNGY5ZDM=
@@ -52,11 +52,13 @@ module Docker
52
52
  @config.logger.error 'Received INT signal...'
53
53
  @producer_finished = true
54
54
  @terminated = true
55
+ @work_queue.clear
55
56
  end
56
57
  Signal.trap('TERM') do
57
58
  @config.logger.error 'Received TERM signal...'
58
59
  @producer_finished = true
59
60
  @terminated = true
61
+ @work_queue.clear
60
62
  end
61
63
  end
62
64
 
@@ -171,7 +173,7 @@ module Docker
171
173
  end
172
174
  ec = 0
173
175
  sleep @config.empty_queue_sleep_time unless @terminated
174
- rescue Exception => e
176
+ rescue => e
175
177
  @config.logger.error "An unknown error occurred while monitoring queue: #{e}"
176
178
  @config.logger.error e.traceback
177
179
  @config.logger.error 'Exiting...'
@@ -34,7 +34,7 @@ module Docker
34
34
 
35
35
  img_id = s3_source.get_object(bucket: source_bucket, key: "registry/repositories/#{image}/tag_#{tag}").body.read
36
36
  sync_image(img_id, bucket, region, sse, source_bucket, source_region)
37
- rescue Exception => e
37
+ rescue => e
38
38
  @config.logger.error "An unexpected error occoured while syncing tag #{image}:#{tag}: #{e}"
39
39
  @config.logger.error e.backtrace
40
40
  false
@@ -57,7 +57,7 @@ module Docker
57
57
  JSON.load(img_index_resp.body.read).each do |image|
58
58
  sync_image(image['id'], bucket, region, sse, source_bucket, source_region)
59
59
  end
60
- rescue Exception => e
60
+ rescue => e
61
61
  @config.logger.error "An unexpected error occoured while syncing repo #{repo}: #{e}"
62
62
  @config.logger.error e.backtrace
63
63
  false
@@ -147,15 +147,16 @@ module Docker
147
147
  begin
148
148
  target_client.copy_object(opts)
149
149
  success = true
150
- rescue Exception => e
150
+ @config.logger.info "Worker finished syncing key: #{opts[:key]}"
151
+ rescue => e
151
152
  @config.logger.error "An unknown error occoured while copying object in s3: #{e}"
152
153
  @config.logger.error e.backtrace
154
+ ensure
155
+ Thread.current['finished'] = true
156
+ @threads.synchronize do
157
+ @status_queue << success
158
+ end
153
159
  end
154
- Thread.current['finished'] = true
155
- @threads.synchronize do
156
- @status_queue << success
157
- end
158
- @config.logger.info "Worker finished syncing key: #{opts[:key]}"
159
160
  end
160
161
  else
161
162
  @config.logger.info "Queued work empty: #{opts}"
@@ -1,7 +1,7 @@
1
1
  module Docker
2
2
  module Registry
3
3
  module Sync
4
- VERSION = '0.2.8'
4
+ VERSION = '0.2.9'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-registry-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Oldfield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-10 00:00:00.000000000 Z
11
+ date: 2015-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler