mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-23 15:37:01 +00:00
queue: Check that we can create the queue directory
When creating a new Queue instance, we os.MkdirAll the queue directory. Currently we don't check if it fails, which will cause us to find out about problems when the queue is first used, where it is more annoying to troubleshoot. This patch adjusts the code so that we check and propagate the error. That way, problems with the queue directory will be more evident and easier to handle.
This commit is contained in:
@@ -147,8 +147,12 @@ func (s *Server) InitDomainInfo(dir string) *domaininfo.DB {
|
||||
|
||||
// InitQueue initializes the queue.
|
||||
func (s *Server) InitQueue(path string, localC, remoteC courier.Courier) {
|
||||
q := queue.New(path, s.localDomains, s.aliasesR, localC, remoteC)
|
||||
err := q.Load()
|
||||
q, err := queue.New(path, s.localDomains, s.aliasesR, localC, remoteC)
|
||||
if err != nil {
|
||||
log.Fatalf("Error initializing queue: %v:", err)
|
||||
}
|
||||
|
||||
err = q.Load()
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading queue: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user