Skip to content

Commit a68d5f7

Browse files
author
kuba--
committed
Do not register pilosa driver if no connection.
Signed-off-by: kuba-- <[email protected]>
1 parent ac4b208 commit a68d5f7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cmd/gitbase/command/server.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,13 @@ func (c *Server) registerDrivers() error {
186186

187187
logrus.Debug("created index storage")
188188

189-
client, err := gopilosa.NewClient(c.PilosaURL)
190-
if err != nil {
191-
return err
189+
if client, err := gopilosa.NewClient(c.PilosaURL); err == nil {
190+
logrus.Debug("established connection with pilosa")
191+
c.engine.Catalog.RegisterIndexDriver(pilosa.NewDriver(filepath.Join(c.IndexDir, pilosa.DriverID), client))
192+
} else {
193+
logrus.WithError(err).Warn("cannot connect to pilosa")
192194
}
193195

194-
logrus.Debug("established connection with pilosa")
195-
196-
c.engine.Catalog.RegisterIndexDriver(pilosa.NewDriver(filepath.Join(c.IndexDir, pilosa.DriverID), client))
197196
c.engine.Catalog.RegisterIndexDriver(pilosalib.NewDriver(filepath.Join(c.IndexDir, pilosalib.DriverID)))
198197
logrus.Debug("registered pilosa index driver")
199198

0 commit comments

Comments
 (0)