aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-10-23 13:30:29 -0400
committerDrew DeVault <sir@cmpwn.com>2020-10-23 13:30:29 -0400
commitb93b2bafa56ee79fa5d70b4c15901981215fa935 (patch)
tree36e17ab04c4d34f4597c99a250be880f74fd8c2d /server.go
parent8764397b7d641450009436196f300dadbe770f1d (diff)
downloadalps-b93b2bafa56ee79fa5d70b4c15901981215fa935.tar.gz
alps-b93b2bafa56ee79fa5d70b4c15901981215fa935.zip
Rig up dowork event queue and graceful termination
Diffstat (limited to 'server.go')
-rw-r--r--server.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/server.go b/server.go
index 7d7a431..dc2708e 100644
--- a/server.go
+++ b/server.go
@@ -10,6 +10,7 @@ import (
"sync"
"time"
+ "git.sr.ht/~sircmpwn/dowork"
"github.com/fernet/fernet-go"
"github.com/labstack/echo/v4"
)
@@ -24,6 +25,7 @@ type Server struct {
e *echo.Echo
Sessions *SessionManager
Options *Options
+ Queue *work.Queue
mutex sync.RWMutex // used for server reload
plugins []Plugin
@@ -66,6 +68,7 @@ func newServer(e *echo.Echo, options *Options) (*Server, error) {
}
s.Sessions = newSessionManager(s.dialIMAP, s.dialSMTP, e.Logger, options.Debug)
+ s.Queue = work.NewQueue("alps")
return s, nil
}