mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
datastore no longer implements logstore (#1013)
* datastore no longer implements logstore the underlying implementation of our sql store implements both the datastore and the logstore interface, however going forward we are likely to encounter datastore implementers that would mock out the logstore interface and not use its methods - signalling a poor interface. this remedies that, now they are 2 completely separate things, which our sqlstore happens to implement both of. related to some recent changes around wrapping, this keeps the imposed metrics and validation wrapping of a servers logstore and datastore, just moving it into New instead of in the opts - this is so that a user can have the underlying datastore in order to set the logstore to it, since wrapping it in a validator/metrics would render it no longer a logstore implementer (i.e. validate datastore doesn't implement the logstore interface), we need to do this after setting the logstore to the datastore if one wasn't provided explicitly. * splits logstore and datastore metrics & validation logic * `make test` should be `make full-test` always. got rid of that so that nobody else has to wait for CI to blow up on them after the tests pass locally ever again. * fix new tests
This commit is contained in:
@@ -192,7 +192,7 @@ func (da *directDataAccess) Finish(ctx context.Context, mCall *models.Call, stde
|
||||
// and Datastore are different, it will call Close on the Logstore as well.
|
||||
func (da *directDataAccess) Close() error {
|
||||
err := da.ds.Close()
|
||||
if da.ds != da.ls {
|
||||
if ls, ok := da.ds.(models.LogStore); ok && ls != da.ls {
|
||||
if daErr := da.ls.Close(); daErr != nil {
|
||||
err = daErr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user