Bypass the fanout storage merging if no remote storage is configured.

pull/3339/head
Tom Wilkie 2017-10-23 21:34:53 +01:00
parent c3d6abc8e6
commit 4bbef0ec30
1 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,10 @@ type fanout struct {
// NewFanout returns a new fan-out Storage, which proxies reads and writes
// through to multiple underlying storages.
func NewFanout(logger log.Logger, primary Storage, secondaries ...Storage) Storage {
if len(secondaries) == 0 {
return primary
}
return &fanout{
logger: logger,
primary: primary,