Skip to content

Commit

Permalink
engine: resources: svc: Reduce unnecessary logging
Browse files Browse the repository at this point in the history
  • Loading branch information
purpleidea committed Sep 19, 2024
1 parent 06a023c commit b9e093c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions engine/resources/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ func (obj *SvcRes) Watch(ctx context.Context) error {
}

if invalid {
obj.init.Logf("waiting for service") // waiting for svc to appear...
if obj.init.Debug {
obj.init.Logf("waiting for service") // waiting for svc to appear...
}
if activeSet {
activeSet = false
set.Remove(svc) // no return value should ever occur
Expand All @@ -240,11 +242,13 @@ func (obj *SvcRes) Watch(ctx context.Context) error {
set.Add(svc) // no return value should ever occur
}

obj.init.Logf("watching...") // attempting to watch...
//obj.init.Logf("watching...") // attempting to watch...
select {
case event := <-subChannel:

obj.init.Logf("event: %+v", event)
if obj.init.Debug {
obj.init.Logf("event: %+v", event)
}
// NOTE: the value returned is a map for some reason...
if event[svc] != nil {
// event[svc].ActiveState is not nil
Expand Down Expand Up @@ -352,7 +356,6 @@ func (obj *SvcRes) CheckApply(ctx context.Context, apply bool) (bool, error) {
}

// apply portion
obj.init.Logf("Apply")
files := []string{svc} // the svc represented in a list
if obj.Startup == "enabled" {
_, _, err = conn.EnableUnitFilesContext(ctx, files, false, true)
Expand Down

0 comments on commit b9e093c

Please sign in to comment.