MCPcopy Create free account
hub / github.com/Rello/analytics / executeBySchedule

Method executeBySchedule

lib/Service/DataloadService.php:157–168  ·  view source on GitHub ↗

* execute all data loads depending on their schedule * Daily or Hourly * * @param $schedule * @return void * @throws Exception */

($schedule)

Source from the content-addressed store, hash-verified

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

Callers 6

runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 4

executeMethod · 0.95
getDataloadByScheduleMethod · 0.80
triggerNotificationMethod · 0.80
readMethod · 0.45