Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix datastore for multiple final result #129

Merged
merged 2 commits into from
Sep 27, 2018
Merged
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
9 changes: 4 additions & 5 deletions src/nni_manager/core/nniDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,11 @@ class NNIDataStore implements DataStore {

private async getFinalMetricData(trialJobId: string): Promise<any> {
const metrics: MetricDataRecord[] = await this.getMetricData(trialJobId, 'FINAL');
assert(metrics.length <= 1);
if (metrics.length === 1) {
return metrics[0];
} else {
return undefined;
if (metrics.length > 1) {
this.log.error(`Found multiple final results for trial job: ${trialJobId}`);
}

return metrics[0];
}

private getJobStatusByLatestEvent(event: TrialJobEvent): TrialJobStatus {
Expand Down