* execute all data loads depending on their schedule * Daily or Hourly * * @param $schedule * @return void * @throws Exception */
($schedule)
| 155 | * @throws Exception |
| 156 | */ |
| 157 | public function executeBySchedule($schedule) |
| 158 | { |
| 159 | $schedules = $this->DataloadMapper->getDataloadBySchedule($schedule); |
| 160 | foreach ($schedules as $dataload) { |
| 161 | $result = $this->execute($dataload['id'], null, false); |
| 162 | if ($result['error'] !== 0 && $result['insert'] === 0 && $result['update'] === 0) { |
| 163 | // Only notify when the data load failed completely, not when individual records failed. |
| 164 | $dataset = $this->DatasetService->read($dataload['dataset']); |
| 165 | $this->NotificationManager->triggerNotification(NotificationManager::DATALOAD_ERROR, $dataload['dataset'], $dataload['id'], ['dataloadName' => $dataload['name'], 'datasetName' => $dataset['name']], $dataload['user_id']); |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * execute a data load from data source and store into dataset |