imap-backup 3.3.0 → 3.3.1

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
  SHA256:
3
- metadata.gz: 78b548972cde69ce86be3d23e21dd973730f414b90e5fd0526fd94c2852dc031
4
- data.tar.gz: d83b2679e25bea24837b3474ce53c5dede5e90e3611b4c2e7374930dc531aa20
3
+ metadata.gz: c3446b53604f5895cb09b109cbe663bc4ac131daeb63989b09ae8985c480464b
4
+ data.tar.gz: 8c3b6a7176dbda814f208505c49ed63f27d650f683dad7941734e8dbd4018601
5
5
  SHA512:
6
- metadata.gz: 419aa2779f25fdb7d34d50b8931a7c77118042082bad3e8d4dcc94a0b5b0a9084d20a684bfe8b8e8b6820f134e3e4f6a3ec0e1d185ad53eb6ccb6ec718f97371
7
- data.tar.gz: 90a2a552949b4977acd5bbe920de73ac2f39a20bd3c7656dbac1000176d7457c7969305334d9be7e8d3ec8075f292dbbff2901246022dd5e51d65104e507c8df
6
+ metadata.gz: 6926f54cb421029116f0e63533e1a3c3151937c9572b2c5b2143cab08e3c1aef81cba6ae3dcc2c799f77e37f3b983c4adee73f6fa90f585cddf030cff8fffd9d
7
+ data.tar.gz: 1ed5e647c1ef08049f928293295cb564d7e87b592dd499dc903bab74717892fffc2aa19d4f214824757dcb80f46356c12864a7cf8332b3f25512c1af637f1aff
@@ -64,7 +64,12 @@ module Imap::Backup
64
64
 
65
65
  Imap::Backup.logger.debug "[#{folder.name}] running backup"
66
66
  serializer.apply_uid_validity(folder.uid_validity)
67
- Downloader.new(folder, serializer).run
67
+ begin
68
+ Downloader.new(folder, serializer).run
69
+ rescue Net::IMAP::ByeResponseError
70
+ reconnect
71
+ retry
72
+ end
68
73
  end
69
74
  end
70
75
 
@@ -3,7 +3,7 @@ module Imap; end
3
3
  module Imap::Backup
4
4
  MAJOR = 3
5
5
  MINOR = 3
6
- REVISION = 0
6
+ REVISION = 1
7
7
  PRE = nil
8
8
  VERSION = [MAJOR, MINOR, REVISION, PRE].compact.map(&:to_s).join(".")
9
9
  end
@@ -288,6 +288,24 @@ describe Imap::Backup::Account::Connection do
288
288
  end
289
289
  end
290
290
 
291
+ context "when the IMAP session expires" do
292
+ before do
293
+ data = OpenStruct.new(data: "Session expired")
294
+ response = OpenStruct.new(data: data)
295
+ outcomes = [
296
+ -> { raise Net::IMAP::ByeResponseError, response },
297
+ -> { nil }
298
+ ]
299
+ allow(downloader).to receive(:run) { outcomes.shift.call }
300
+ end
301
+
302
+ it "reconnects" do
303
+ expect(downloader).to receive(:run).exactly(:twice)
304
+
305
+ subject.run_backup
306
+ end
307
+ end
308
+
291
309
  context "when run" do
292
310
  before { subject.run_backup }
293
311
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imap-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Yates