File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
2323 "github.com/caarlos0/env"
2424 "github.com/devtron-labs/common-lib/constants"
2525 pubsub "github.com/devtron-labs/common-lib/pubsub-lib"
26+ "github.com/devtron-labs/common-lib/pubsub-lib/metrics"
2627 "github.com/devtron-labs/common-lib/pubsub-lib/model"
2728 "github.com/devtron-labs/git-sensor/internals"
2829 "github.com/devtron-labs/git-sensor/internals/middleware"
@@ -49,6 +50,8 @@ type GitWatcherImpl struct {
4950 gitManager GitManager
5051}
5152
53+ const PANIC = "panic"
54+
5255type GitWatcher interface {
5356 PollAndUpdateGitMaterial (material * sql.GitMaterial ) (* sql.GitMaterial , error )
5457}
@@ -371,6 +374,9 @@ func (impl *CronLoggerImpl) Info(msg string, keysAndValues ...interface{}) {
371374}
372375
373376func (impl * CronLoggerImpl ) Error (err error , msg string , keysAndValues ... interface {}) {
377+ if msg == PANIC {
378+ metrics .IncPanicRecoveryCount ("cron" , "" , "" , "" )
379+ }
374380 keysAndValues = append ([]interface {}{"err" , err }, keysAndValues ... )
375381 impl .logger .Errorw (msg , keysAndValues ... )
376382}
You can’t perform that action at this time.
0 commit comments