Skip to content

Commit

Permalink
Catch ambiguous state definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
demophoon committed Dec 12, 2024
1 parent 56f3822 commit 2ecf709
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ func New(config *config.Config) ShrlsService {
log.Fatal("State backend is undefined")
}
var state server.ServerState
if config.StateBackend.Bolt != nil && config.StateBackend.Mongo != nil {
log.Fatal("Ambiguous state backend defined. Please use a single state backend.")
}
if config.StateBackend.Bolt != nil {
state = boltstate.New(*config)
s.SetState(state)
Expand Down

0 comments on commit 2ecf709

Please sign in to comment.