@@ -111,7 +111,7 @@ func RunTaskByUnitName(name string) error {
111111
112112// RotateTasks checks if no other rotators are running, then performs initial
113113// checks and starts rotating every 5 seconds
114- func RotateTasks (event string ) error {
114+ func RotateTasks (event string , silent bool ) error {
115115 if isTasksRotatorIsRunning () {
116116 fmt .Println ("Rotator is already running" )
117117 return nil
@@ -128,9 +128,11 @@ func RotateTasks(event string) error {
128128 }
129129
130130 for {
131- fmt .Println ("---" )
131+ if ! silent {
132+ fmt .Println ("---" )
133+ }
132134 cChecks := GetCommonChecks ()
133- err := runTasksRotator (cChecks , event )
135+ err := runTasksRotator (cChecks , event , silent )
134136 if err != nil {
135137 fmt .Println (err )
136138 }
@@ -140,7 +142,7 @@ func RotateTasks(event string) error {
140142}
141143
142144// runTasksRotator checks which tasks should be run and starts rotating
143- func runTasksRotator (cChecks * CommonChecks , event string ) error {
145+ func runTasksRotator (cChecks * CommonChecks , event string , silent bool ) error {
144146 var err error
145147 CurrentQueue , err = ListTasksDetailed ()
146148 if err != nil {
@@ -166,7 +168,9 @@ func runTasksRotator(cChecks *CommonChecks, event string) error {
166168
167169 CurrentQueue = []Task {}
168170
169- fmt .Printf ("Rotated %d tasks, %d failed, %d success\n " , rotatedN , rotatedNFails , rotatedNSuccess )
171+ if ! silent {
172+ fmt .Printf ("Rotated %d tasks, %d failed, %d success\n " , rotatedN , rotatedNFails , rotatedNSuccess )
173+ }
170174
171175 return nil
172176}
0 commit comments