Ejemplo n.º 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
}
Ejemplo n.º 2
0
// 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
}