From c5afd1a61b06b3d5bd7287d1596b05d4c18ac138 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 9 Dec 2019 19:25:45 +0100 Subject: Reconnect to IMAP server when logged out The session manager has been upgraded to deal with reconnections. Each session has its own expiration timer. Each time a request is received, the expiration timer is reset. A session can be closed (this is used when the user wants to logout). When the IMAP connection is closed by the server, it's set to nil in the session. The next time an IMAP command needs to be issued, the connection is re-established. Closes: https://todo.sr.ht/~sircmpwn/koushin/30 --- server.go | 1 + 1 file changed, 1 insertion(+) (limited to 'server.go') diff --git a/server.go b/server.go index 94cc133..0ab7f24 100644 --- a/server.go +++ b/server.go @@ -173,6 +173,7 @@ func New(e *echo.Echo, options *Options) error { } else if err != nil { return err } + ctx.session.Ping() return next(ctx) } -- cgit v1.2.3-59-g8ed1b