Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openml_OS/libraries/ElasticSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public function index($type, $id = false, $altmetrics=True, $verbosity=0) {
return $this->$method_name($id, $altmetrics, $verbosity);
} catch (Exception $e) {
echo $e->getMessage();
// TODO: log?
log_message('error', '[ElasticSearch] Indexing failed for type ' . $type . ' (id: ' . ($id ?: 'all') . '): ' . $e->getMessage());
}
} else {
return 'No function exists to build index of type ' . $type;
Expand All @@ -352,7 +352,7 @@ public function index_from($type, $id = false, $verbosity=1, $altmetrics=False)
return $this->$method_name(false, $id, $altmetrics, $verbosity);
} catch (Exception $e) {
echo $e->getMessage();
// TODO: log?
log_message('error', '[ElasticSearch] Indexing from id failed for type ' . $type . ' (from id: ' . ($id ?: '0') . '): ' . $e->getMessage());
}
} else {
return 'No function exists to build index of type ' . $type;
Expand Down
2 changes: 1 addition & 1 deletion openml_OS/models/api/v1/Api_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ private function data_upload() {
// update counters
$this->elasticsearch->index('user', $this->user_id);
} catch (Exception $e) {
// TODO: should log
log_message('error', '[Api_data] ElasticSearch indexing failed for data id ' . $id . ': ' . $e->getMessage());
}

// insert tags. This relies on the ES record to exist.
Expand Down
4 changes: 2 additions & 2 deletions openml_OS/models/api/v1/Api_flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ private function flow_upload() {
// update counters
$this->elasticsearch->index('user', $this->user_id);
} catch (Exception $e) {
// TODO: should be logged
log_message('error', '[Api_flow] ElasticSearch indexing failed for flow id ' . $impl . ': ' . $e->getMessage());
}

$this->xmlContents( 'implementation-upload', $this->version, $implementation );
Expand Down Expand Up @@ -855,7 +855,7 @@ private function insertImplementationFromXML( $xml, $configuration, $implementat
try {
$this->elasticsearch->index('flow', $flow_id);
} catch (Exception $e) {
// TODO should be logged
log_message('error', '[Api_flow] ElasticSearch indexing failed for flow id ' . $flow_id . ': ' . $e->getMessage());
}


Expand Down
2 changes: 1 addition & 1 deletion openml_OS/models/api/v1/Api_run.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ private function run_upload() {
try {
$this->elasticsearch->index('run', $runId);
} catch (Exception $e) {
// TODO: should log
log_message('error', '[Api_run] ElasticSearch indexing failed for run id ' . $runId . ': ' . $e->getMessage());
}

$timestamps[] = microtime(true); // profiling 4
Expand Down
2 changes: 1 addition & 1 deletion openml_OS/models/api/v1/Api_study.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private function study_create() {
// update counters
$this->elasticsearch->index('user', $this->user_id);
} catch (Exception $e) {
// TODO: should log
log_message('error', '[Api_study] ElasticSearch indexing failed for study id ' . $study_id . ': ' . $e->getMessage());
}

$this->xmlContents('study-upload', $this->version, array('study_id' => $study_id));
Expand Down