Document defaults
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
parent
374f04d0e9
commit
bae47820d7
@ -165,6 +165,8 @@ type DeleteImageRequest struct {
|
|||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
// Sync indicates that the delete and cleanup should be done
|
// Sync indicates that the delete and cleanup should be done
|
||||||
// synchronously before returning to the caller
|
// synchronously before returning to the caller
|
||||||
|
//
|
||||||
|
// Default is false
|
||||||
Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"`
|
Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,5 +118,7 @@ message DeleteImageRequest {
|
|||||||
|
|
||||||
// Sync indicates that the delete and cleanup should be done
|
// Sync indicates that the delete and cleanup should be done
|
||||||
// synchronously before returning to the caller
|
// synchronously before returning to the caller
|
||||||
|
//
|
||||||
|
// Default is false
|
||||||
bool sync = 2;
|
bool sync = 2;
|
||||||
}
|
}
|
||||||
|
@ -230,6 +230,7 @@ func (s *gcScheduler) run(ctx context.Context) {
|
|||||||
interval = time.Second
|
interval = time.Second
|
||||||
gcTime time.Duration
|
gcTime time.Duration
|
||||||
collections int
|
collections int
|
||||||
|
// TODO(dmcg): expose collection stats as metrics
|
||||||
|
|
||||||
triggered bool
|
triggered bool
|
||||||
deletions int
|
deletions int
|
||||||
@ -270,6 +271,7 @@ func (s *gcScheduler) run(ctx context.Context) {
|
|||||||
(s.mutationThreshold > 0 && mutations >= s.mutationThreshold))) {
|
(s.mutationThreshold > 0 && mutations >= s.mutationThreshold))) {
|
||||||
// Check if not already scheduled before delay threshold
|
// Check if not already scheduled before delay threshold
|
||||||
if nextCollection == nil || nextCollection.After(time.Now().Add(s.scheduleDelay)) {
|
if nextCollection == nil || nextCollection.After(time.Now().Add(s.scheduleDelay)) {
|
||||||
|
// TODO(dmcg): track re-schedules for tuning schedule config
|
||||||
schedC, nextCollection = schedule(s.scheduleDelay)
|
schedC, nextCollection = schedule(s.scheduleDelay)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ func init() {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewService(m.(*metadata.DB), g.(gcScheduler), ic.Events), nil
|
return NewService(m.(*metadata.DB), ic.Events, g.(gcScheduler)), nil
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ type service struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewService returns the GRPC image server
|
// NewService returns the GRPC image server
|
||||||
func NewService(db *metadata.DB, gc gcScheduler, publisher events.Publisher) imagesapi.ImagesServer {
|
func NewService(db *metadata.DB, publisher events.Publisher, gc gcScheduler) imagesapi.ImagesServer {
|
||||||
return &service{
|
return &service{
|
||||||
db: db,
|
db: db,
|
||||||
gc: gc,
|
gc: gc,
|
||||||
|
Loading…
Reference in New Issue
Block a user