aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-07-24 01:00:11 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-07-24 01:00:11 +0200
commit53053c5d8c96dde34dd08963d87edf1c90b16fc4 (patch)
tree515e5e6722c29543c55a6752d234e0953607d27b
parent2c3587a8484ce08dd84b54b9c05a7382945a24bd (diff)
downloadfeed2imap-go-53053c5d8c96dde34dd08963d87edf1c90b16fc4.tar.gz
feed2imap-go-53053c5d8c96dde34dd08963d87edf1c90b16fc4.tar.bz2
feed2imap-go-53053c5d8c96dde34dd08963d87edf1c90b16fc4.zip
Fix IMAP disconnect
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index 26582b7..95eee73 100644
--- a/main.go
+++ b/main.go
@@ -110,7 +110,10 @@ func run() error {
imapErr <- err
}()
- defer c.Disconnect()
+ defer func() {
+ // capture c and not evaluate it, before connect has run
+ c.Disconnect()
+ }()
}
if success := state.Fetch(); success == 0 {