This commit is contained in:
Rain
2019-09-27 13:59:53 +08:00
parent 27b9211d63
commit e3ea4e3bb8
3 changed files with 9 additions and 3 deletions

View File

@@ -258,6 +258,12 @@ var (
Action: PolicyActionUpdate,
Result: rbacutils.Allow,
},
{
Service: "notify",
Resource: "contacts",
Action: PolicyActionList,
Result: rbacutils.Allow,
},
},
},
{

View File

@@ -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

View File

@@ -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)