示例#1
0
// checkRecovering checks if the backend can be recovered.
func (m *systemMonitor) checkRecovering(rs loop.Recoverings) (loop.Recoverings, error) {
	if rs.Frequency(12, time.Minute) {
		logger.Errorf("monitor cannot be recovered: %v", rs.Last().Reason)
		return nil, errors.New(ErrMonitorCannotBeRecovered, errorMessages, rs.Last().Reason)
	}
	logger.Warningf("monitor recovered: %v", rs.Last().Reason)
	return rs.Trim(12), nil
}
示例#2
0
文件: timex.go 项目: pellaeon/goas
// checkRecovering checks if the backend can be recovered.
func (c *Crontab) checkRecovering(rs loop.Recoverings) (loop.Recoverings, error) {
	if rs.Frequency(12, time.Minute) {
		logger.Errorf("crontab cannot be recovered: %v", rs.Last().Reason)
		return nil, errors.New(ErrCrontabCannotBeRecovered, errorMessages, rs.Last().Reason)
	}
	logger.Warningf("crontab recovered: %v", rs.Last().Reason)
	return rs.Trim(12), nil
}