Print log when timetrigger is removed (#209)
This commit is contained in:
committed by
Soam Vasani
parent
990d943f21
commit
2f6cd6d659
+4
-3
@@ -17,10 +17,10 @@ limitations under the License.
|
|||||||
package timer
|
package timer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/robfig/cron"
|
|
||||||
|
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"github.com/robfig/cron"
|
||||||
|
|
||||||
"github.com/fission/fission"
|
"github.com/fission/fission"
|
||||||
"github.com/fission/fission/publisher"
|
"github.com/fission/fission/publisher"
|
||||||
)
|
)
|
||||||
@@ -121,6 +121,7 @@ func (timer *Timer) syncCron(triggers []fission.TimeTrigger) error {
|
|||||||
if !found {
|
if !found {
|
||||||
if v.cron != nil {
|
if v.cron != nil {
|
||||||
v.cron.Stop()
|
v.cron.Stop()
|
||||||
|
log.Printf("Cron for time trigger %s stopped", v.trigger.Name)
|
||||||
}
|
}
|
||||||
delete(timer.triggers, k)
|
delete(timer.triggers, k)
|
||||||
}
|
}
|
||||||
@@ -138,6 +139,6 @@ func (timer *Timer) newCron(t fission.TimeTrigger) *cron.Cron {
|
|||||||
(*timer.publisher).Publish("", headers, fission.UrlForFunction(&t.Function))
|
(*timer.publisher).Publish("", headers, fission.UrlForFunction(&t.Function))
|
||||||
})
|
})
|
||||||
c.Start()
|
c.Start()
|
||||||
log.Printf("Updated new cron for %v", t.Name)
|
log.Printf("Add new cron for time trigger %v", t.Name)
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user