Skip to content

Commit

Permalink
Fix Logic
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
  • Loading branch information
mahadzaryab1 committed Jan 24, 2025
1 parent ba068b1 commit aea0e8b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,16 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger)
}
}

uninitializedArchiveFactories := make(map[string]struct{})
for kind, factory := range f.archiveFactories {
if archivable, ok := factory.(plugin.ArchiveCapable); ok && archivable.IsArchiveCapable() {
if err := initializeFactory(kind, factory, "primary"); err != nil {
uninitializedArchiveFactories[kind] = struct{}{}
if err := initializeFactory(kind, factory, "archive"); err != nil {
return err
}
} else {
delete(f.archiveFactories, kind)
}
}

for kind := range uninitializedArchiveFactories {
delete(f.archiveFactories, kind)
}

f.publishOpts()
return nil
}
Expand Down

0 comments on commit aea0e8b

Please sign in to comment.