diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index eeea75628..a0b2703b6 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -19,7 +19,6 @@ type Service struct{} // Set implements the SettingsServiceHandler interface generated on accounts.pb.micro.go func (s Service) Set(c context.Context, req *proto.Record, res *proto.Record) error { - // TODO this should be a globally initialized struct st := store.New() settingsJSON, err := json.Marshal(req.Payload) diff --git a/pkg/store/filesystem/store.go b/pkg/store/filesystem/store.go index f2c81c23d..317e3b75d 100644 --- a/pkg/store/filesystem/store.go +++ b/pkg/store/filesystem/store.go @@ -23,16 +23,18 @@ type Store struct { // New returns a new file system store manager // TODO add mountPath as a flag. Accept a *config argument func New() Store { + store := Store{ + logger: olog.NewLogger(), + } + // default to the current working directory if not configured dir, err := filepath.Abs(filepath.Dir(os.Args[0])) if err != nil { - // TODO log error - // TODO deal with this - } - return Store{ - mountPath: dir, - logger: olog.NewLogger(), + store.logger.Err(err).Msg("initializing the accounts store") } + store.mountPath = dir + + return store } // Init implements the store interface