-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User persister factory in storage unit #32
Conversation
storageUnit/storageunit.go
Outdated
@@ -378,21 +374,14 @@ type ArgDB struct { | |||
} | |||
|
|||
// NewDB creates a new database from database config | |||
func NewDB(argDB ArgDB) (types.Persister, error) { | |||
// TODO: refactor to integrate retries loop into persister factory; maybe implement persister | |||
// factory separatelly in storage repo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra indent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
func NewDB(argDB ArgDB) (types.Persister, error) { | ||
// TODO: refactor to integrate retries loop into persister factory; maybe implement persister | ||
// factory separatelly in storage repo | ||
func NewDB(persisterFactory PersisterFactoryHandler, path string) (types.Persister, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for extra protection (even if this is temporary) I would add a nil check for the provided persisterFactory. Maybe make the interface implement NilInterfaceChecker
interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added nil check
No description provided.