Skip to content

Commit

Permalink
speed up cached training data check
Browse files Browse the repository at this point in the history
  • Loading branch information
isaak committed Jul 21, 2023
1 parent 5fba930 commit 46cf4e2
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lib/SGN/Controller/solGS/CachedResult.pm
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,8 @@ sub check_cached_genotype_data {
$c->controller('solGS::Files')->genotype_file_name( $c, $pop_id );
my $file = $c->stash->{genotype_file_name};

my $cached;
if ( -s $file ) {
my @rows = read_file( $file, { binmode => ':utf8' } );
$cached = 1 if $rows[1];
}

return $cached;
my $count = $c->controller('solGS::Utils')->count_data_rows($file);
return $count;

}

Expand All @@ -391,13 +386,8 @@ sub check_cached_phenotype_data {
$c->controller('solGS::Files')->phenotype_file_name( $c, $pop_id );
my $file = $c->stash->{phenotype_file_name};

my $cached;
if ( -s $file ) {
my @rows = read_file( $file, { binmode => ':utf8' } );
$cached = 1 if $rows[1];
}

return $cached;
my $count = $c->controller('solGS::Utils')->count_data_rows($file);
return $count;

}

Expand Down

0 comments on commit 46cf4e2

Please sign in to comment.