satellite/orders: remove unused service dependency
Orders service doesn't need buckets service anymore. Change-Id: I27853cda87e82b528f53667e4b4866801f7bfb62
This commit is contained in:
parent
88328ab240
commit
a97cd97789
@ -149,7 +149,7 @@ func verifySegmentsRange(cmd *cobra.Command, args []string) error {
|
||||
return Error.Wrap(err)
|
||||
}
|
||||
|
||||
ordersService, err := orders.NewService(log.Named("orders"), signing.SignerFromFullIdentity(identity), overlay, db.Orders(), db.Buckets(), satelliteCfg.Orders)
|
||||
ordersService, err := orders.NewService(log.Named("orders"), signing.SignerFromFullIdentity(identity), overlay, db.Orders(), satelliteCfg.Orders)
|
||||
if err != nil {
|
||||
return Error.Wrap(err)
|
||||
}
|
||||
|
@ -374,7 +374,6 @@ func NewAPI(log *zap.Logger, full *identity.FullIdentity, db DB,
|
||||
signing.SignerFromFullIdentity(peer.Identity),
|
||||
peer.Overlay.Service,
|
||||
peer.Orders.DB,
|
||||
peer.Buckets.Service,
|
||||
config.Orders,
|
||||
)
|
||||
if err != nil {
|
||||
|
@ -31,7 +31,6 @@ import (
|
||||
"storj.io/storj/satellite/accounting/rolluparchive"
|
||||
"storj.io/storj/satellite/accounting/tally"
|
||||
"storj.io/storj/satellite/audit"
|
||||
"storj.io/storj/satellite/buckets"
|
||||
"storj.io/storj/satellite/console/consoleauth"
|
||||
"storj.io/storj/satellite/console/emailreminders"
|
||||
"storj.io/storj/satellite/gracefulexit"
|
||||
@ -151,10 +150,6 @@ type Core struct {
|
||||
Metrics struct {
|
||||
Chore *metrics.Chore
|
||||
}
|
||||
|
||||
Buckets struct {
|
||||
Service *buckets.Service
|
||||
}
|
||||
}
|
||||
|
||||
// New creates a new satellite.
|
||||
@ -171,10 +166,6 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB,
|
||||
Services: lifecycle.NewGroup(log.Named("services")),
|
||||
}
|
||||
|
||||
{ // setup buckets service
|
||||
peer.Buckets.Service = buckets.NewService(db.Buckets(), metabaseDB)
|
||||
}
|
||||
|
||||
{ // setup debug
|
||||
var err error
|
||||
if config.Debug.Address != "" {
|
||||
@ -301,7 +292,6 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB,
|
||||
signing.SignerFromFullIdentity(peer.Identity),
|
||||
peer.Overlay.Service,
|
||||
peer.Orders.DB,
|
||||
peer.Buckets.Service,
|
||||
config.Orders,
|
||||
)
|
||||
if err != nil {
|
||||
|
@ -16,7 +16,6 @@ import (
|
||||
"storj.io/common/pb"
|
||||
"storj.io/common/signing"
|
||||
"storj.io/common/storj"
|
||||
"storj.io/common/uuid"
|
||||
"storj.io/storj/satellite/internalpb"
|
||||
"storj.io/storj/satellite/metabase"
|
||||
"storj.io/storj/satellite/overlay"
|
||||
@ -40,12 +39,6 @@ type Config struct {
|
||||
OrdersSemaphoreSize int `help:"how many concurrent orders to process at once. zero is unlimited" default:"2"`
|
||||
}
|
||||
|
||||
// BucketsDB returns information about buckets.
|
||||
type BucketsDB interface {
|
||||
// GetBucketID returns an existing bucket id.
|
||||
GetBucketID(ctx context.Context, bucket metabase.BucketLocation) (id uuid.UUID, err error)
|
||||
}
|
||||
|
||||
// Service for creating order limits.
|
||||
//
|
||||
// architecture: Service
|
||||
@ -54,7 +47,6 @@ type Service struct {
|
||||
satellite signing.Signer
|
||||
overlay *overlay.Service
|
||||
orders DB
|
||||
buckets BucketsDB
|
||||
|
||||
encryptionKeys EncryptionKeys
|
||||
|
||||
@ -67,8 +59,7 @@ type Service struct {
|
||||
// NewService creates new service for creating order limits.
|
||||
func NewService(
|
||||
log *zap.Logger, satellite signing.Signer, overlay *overlay.Service,
|
||||
orders DB, buckets BucketsDB,
|
||||
config Config,
|
||||
orders DB, config Config,
|
||||
) (*Service, error) {
|
||||
if config.EncryptionKeys.Default.IsZero() {
|
||||
return nil, Error.New("encryption keys must be specified to include encrypted metadata")
|
||||
@ -79,7 +70,6 @@ func NewService(
|
||||
satellite: satellite,
|
||||
overlay: overlay,
|
||||
orders: orders,
|
||||
buckets: buckets,
|
||||
|
||||
encryptionKeys: config.EncryptionKeys,
|
||||
|
||||
|
@ -71,10 +71,6 @@ type Repairer struct {
|
||||
EcRepairer *repairer.ECRepairer
|
||||
SegmentRepairer *repairer.SegmentRepairer
|
||||
Repairer *repairer.Service
|
||||
|
||||
Buckets struct {
|
||||
Service *buckets.Service
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepairer creates a new repairer peer.
|
||||
@ -177,10 +173,6 @@ func NewRepairer(log *zap.Logger, full *identity.FullIdentity,
|
||||
})
|
||||
}
|
||||
|
||||
{ // setup buckets service
|
||||
peer.Buckets.Service = buckets.NewService(bucketsDB, metabaseDB)
|
||||
}
|
||||
|
||||
{ // setup orders
|
||||
peer.Orders.DB = rollupsWriteCache
|
||||
peer.Orders.Chore = orders.NewChore(log.Named("orders:chore"), rollupsWriteCache, config.Orders)
|
||||
@ -198,7 +190,6 @@ func NewRepairer(log *zap.Logger, full *identity.FullIdentity,
|
||||
signing.SignerFromFullIdentity(peer.Identity),
|
||||
peer.Overlay,
|
||||
peer.Orders.DB,
|
||||
peer.Buckets.Service,
|
||||
config.Orders,
|
||||
)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user