From e3ea4e3bb8ff23291db54ebaa345ca7d1fca628e Mon Sep 17 00:00:00 2001 From: Rain Date: Fri, 27 Sep 2019 13:59:53 +0800 Subject: [PATCH] fix --- pkg/cloudcommon/policy/defaults.go | 6 ++++++ pkg/notify/options/options.go | 4 ++-- pkg/notify/service.go | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/cloudcommon/policy/defaults.go b/pkg/cloudcommon/policy/defaults.go index 10b8fd9b4f..24857930e9 100644 --- a/pkg/cloudcommon/policy/defaults.go +++ b/pkg/cloudcommon/policy/defaults.go @@ -258,6 +258,12 @@ var ( Action: PolicyActionUpdate, Result: rbacutils.Allow, }, + { + Service: "notify", + Resource: "contacts", + Action: PolicyActionList, + Result: rbacutils.Allow, + }, }, }, { diff --git a/pkg/notify/options/options.go b/pkg/notify/options/options.go index 370609fd59..f92e069ece 100644 --- a/pkg/notify/options/options.go +++ b/pkg/notify/options/options.go @@ -24,10 +24,10 @@ type NotifyOption struct { DingtalkEnabled bool `help:"Enable dingtalk"` SocketFileDir string `help:"Socket file directory" default:"/etc/yunion/notify"` - UpdateInterval int `help:"Update send services interval(unit:s)" default:30` + UpdateInterval int `help:"Update send services interval(unit:s)" default:"30"` VerifyEmailUrl string `help:"url of verify email"` ReSendScope int `help:"Resend all messages that have not been sent successfully within ReSendScope minutes"` - InitNotificationScope int `help:"initialize data of notification with in InitNotificationScope hours" default:100` + InitNotificationScope int `help:"initialize data of notification with in InitNotificationScope hours" default:"100"` } var Options NotifyOption diff --git a/pkg/notify/service.go b/pkg/notify/service.go index f63f17da3f..42c1437828 100644 --- a/pkg/notify/service.go +++ b/pkg/notify/service.go @@ -63,7 +63,7 @@ func StartService() { models.NotifyService.InitAll() defer models.NotifyService.StopAll() - cron := cronman.GetCronJobManager() + cron := cronman.InitCronJobManager(true, 2) // update service cron.AddJobAtIntervals("UpdateServices", time.Duration(opts.UpdateInterval)*time.Second, models.NotifyService.UpdateServices)