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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3446b53604f5895cb09b109cbe663bc4ac131daeb63989b09ae8985c480464b
|
4
|
+
data.tar.gz: 8c3b6a7176dbda814f208505c49ed63f27d650f683dad7941734e8dbd4018601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/lib/imap/backup/version.rb
CHANGED
@@ -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
|
|