Skip to content

Commit

Permalink
Merge pull request #3620 from solgenomics/topic/pheno_jsonb_refresh
Browse files Browse the repository at this point in the history
Refresh both phenoview and the jsonb matview after adding trait data
  • Loading branch information
lukasmueller authored Jul 15, 2021
2 parents c56b6ad + d675c77 commit 9e7315c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/refresh_matviews.pl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ =head1 AUTHOR
@mv_names = ('materialized_stockprop');
}
if ($mode eq 'phenotypes') {
@mv_names = ("materialized_phenotype_jsonb_table");
@mv_names = ("materialized_phenoview", "materialized_phenotype_jsonb_table");
}

my $status = refresh_mvs($dbh, \@mv_names, $concurrent);
Expand Down
2 changes: 1 addition & 1 deletion lib/CXGN/BrAPI/v1/Observations.pm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ sub observations_store {

## Will need to initiate refresh matviews in controller instead
my $bs = CXGN::BreederSearch->new( { dbh=>$c->dbc->dbh, dbname=>$c->config->{dbname}, } );
my $refresh = $bs->refresh_matviews($c->config->{dbhost}, $c->config->{dbname}, $c->config->{dbuser}, $c->config->{dbpass}, 'fullview', 'concurrent', $c->config->{basepath});
my $refresh = $bs->refresh_matviews($c->config->{dbhost}, $c->config->{dbname}, $c->config->{dbuser}, $c->config->{dbpass}, 'phenotypes', 'concurrent', $c->config->{basepath});

return CXGN::BrAPI::JSONResponse->return_success(\%result, $pagination, \@data_files, $status, $stored_observation_success);

Expand Down
2 changes: 1 addition & 1 deletion lib/SGN/Controller/AJAX/PhenotypesUpload.pm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ sub upload_phenotype_store_POST : Args(1) {

push @$success_status, "Metadata saved for archived file.";
my $bs = CXGN::BreederSearch->new( { dbh=>$c->dbc->dbh, dbname=>$c->config->{dbname}, } );
my $refresh = $bs->refresh_matviews($c->config->{dbhost}, $c->config->{dbname}, $c->config->{dbuser}, $c->config->{dbpass}, 'fullview', 'concurrent', $c->config->{basepath});
my $refresh = $bs->refresh_matviews($c->config->{dbhost}, $c->config->{dbname}, $c->config->{dbuser}, $c->config->{dbpass}, 'phenotypes', 'concurrent', $c->config->{basepath});

$c->stash->{rest} = {success => $success_status, error => $error_status};
}
Expand Down

0 comments on commit 9e7315c

Please sign in to comment.