本文整理匯總了Golang中k8s/io/contrib/mungegithub/config.MungeConfig.ResetAPICount方法的典型用法代碼示例。如果您正苦於以下問題:Golang MungeConfig.ResetAPICount方法的具體用法?Golang MungeConfig.ResetAPICount怎麽用?Golang MungeConfig.ResetAPICount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類k8s/io/contrib/mungegithub/config.MungeConfig
的用法示例。
在下文中一共展示了MungeConfig.ResetAPICount方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: doMungers
func doMungers(config *config.MungeConfig) error {
if len(config.IssueMungers) == 0 && len(config.PRMungersList) == 0 {
glog.Fatalf("must include at least one --issue-mungers or --pr-mungers")
}
for {
nextRunStartTime := time.Now().Add(config.Period)
if len(config.IssueMungers) > 0 {
glog.Infof("Running issue mungers")
if err := issues.MungeIssues(config); err != nil {
glog.Errorf("Error munging issues: %v", err)
}
}
if len(config.PRMungersList) > 0 {
glog.Infof("Running PR mungers")
if err := pulls.MungePullRequests(config); err != nil {
glog.Errorf("Error munging PRs: %v", err)
}
}
config.ResetAPICount()
if config.Once {
break
}
if nextRunStartTime.After(time.Now()) {
sleepDuration := nextRunStartTime.Sub(time.Now())
glog.Infof("Sleeping for %v\n", sleepDuration)
time.Sleep(sleepDuration)
} else {
glog.Infof("Not sleeping as we took more than %v to complete one loop\n", config.Period)
}
}
return nil
}