()
| 129 | } |
| 130 | |
| 131 | func (s *pumpServer) initialize() { |
| 132 | pmps = make([]pumps.Pump, len(s.pumps)) |
| 133 | i := 0 |
| 134 | for key, pmp := range s.pumps { |
| 135 | pumpTypeName := pmp.Type |
| 136 | if pumpTypeName == "" { |
| 137 | pumpTypeName = key |
| 138 | } |
| 139 | |
| 140 | pmpType, err := pumps.GetPumpByName(pumpTypeName) |
| 141 | if err != nil { |
| 142 | log.Errorf("Pump load error (skipping): %s", err.Error()) |
| 143 | } else { |
| 144 | pmpIns := pmpType.New() |
| 145 | initErr := pmpIns.Init(pmp.Meta) |
| 146 | if initErr != nil { |
| 147 | log.Errorf("Pump init error (skipping): %s", initErr.Error()) |
| 148 | } else { |
| 149 | log.Infof("Init Pump: %s", pmpIns.GetName()) |
| 150 | pmpIns.SetFilters(pmp.Filters) |
| 151 | pmpIns.SetTimeout(pmp.Timeout) |
| 152 | pmpIns.SetOmitDetailedRecording(pmp.OmitDetailedRecording) |
| 153 | pmps[i] = pmpIns |
| 154 | } |
| 155 | } |
| 156 | i++ |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func writeToPumps(keys []interface{}, purgeDelay int) { |
| 161 | // Send to pumps |
no test coverage detected