Explicitly set the table name during service init (#1497)

This commit is contained in:
Jake Sanders
2020-04-07 13:00:05 +01:00
committed by GitHub
parent 2ea5b33955
commit 71538adfdc
2 changed files with 16 additions and 20 deletions

View File

@@ -106,12 +106,9 @@ func (s *service) Init(opts ...Option) {
logger.Fatal(err)
}
// If the store has no Table set, fallback to the
// services name
if len(store.DefaultStore.Options().Table) == 0 {
name := s.opts.Cmd.App().Name
store.DefaultStore.Init(store.Table(name))
}
// Explicitly set the table name to the service name
name := s.opts.Cmd.App().Name
store.DefaultStore.Init(store.Table(name))
// TODO: replace Cmd.Init with config.Load
// Right now we're just going to load a token