Document defaults

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2017-11-21 16:12:10 -08:00
parent 374f04d0e9
commit bae47820d7
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB
4 changed files with 8 additions and 2 deletions

View File

@ -165,6 +165,8 @@ type DeleteImageRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Sync indicates that the delete and cleanup should be done
// synchronously before returning to the caller
//
// Default is false
Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"`
}

View File

@ -118,5 +118,7 @@ message DeleteImageRequest {
// Sync indicates that the delete and cleanup should be done
// synchronously before returning to the caller
//
// Default is false
bool sync = 2;
}

View File

@ -230,6 +230,7 @@ func (s *gcScheduler) run(ctx context.Context) {
interval = time.Second
gcTime time.Duration
collections int
// TODO(dmcg): expose collection stats as metrics
triggered bool
deletions int
@ -270,6 +271,7 @@ func (s *gcScheduler) run(ctx context.Context) {
(s.mutationThreshold > 0 && mutations >= s.mutationThreshold))) {
// Check if not already scheduled before delay threshold
if nextCollection == nil || nextCollection.After(time.Now().Add(s.scheduleDelay)) {
// TODO(dmcg): track re-schedules for tuning schedule config
schedC, nextCollection = schedule(s.scheduleDelay)
}
}

View File

@ -36,7 +36,7 @@ func init() {
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
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{
db: db,
gc: gc,