Skip to content

Commit

Permalink
Merge pull request #53 from yma96/1.1.x
Browse files Browse the repository at this point in the history
Add generation-timeout-minutes config
  • Loading branch information
yma96 authored Dec 16, 2024
2 parents 817e37b + d081ec6 commit 86cac22
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ public interface PreSeedConfig

@WithName( "thread-multiplier" )
Optional<Integer> threadMultiplier();

@WithName( "generation-timeout-minutes" )
Optional<Integer> generationTimeoutMinutes();
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void generate( HistoricalContentDTO content )
{
if ( isInProgress( buildConfigId ) )
{
logger.info( "There is already generation process in progress for buildConfigId {}, try lock wait.",
logger.info( "There is already generation process in progress for buildConfigId {}, this request will skip.",
buildConfigId );
// Conflicted generation, just return immediately
return;
Expand Down Expand Up @@ -192,7 +192,7 @@ public void generate( HistoricalContentDTO content )
} );
try
{
future.get( 60, TimeUnit.MINUTES );
future.get( preSeedConfig.generationTimeoutMinutes().orElse( 60 ), TimeUnit.MINUTES );
}
catch ( TimeoutException e )
{
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ pre-seed:
main-indy: https://indy-gateway-master-devel.psi.redhat.com
storage-dir: data
not-used-days-cleanup: 10
thread-multiplier: 4
thread-multiplier: 4
generation-timeout-minutes: 60
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public Optional<Integer> threadMultiplier()
return Optional.of( 4 );
}

public Optional<Integer> generationTimeoutMinutes()
{
return Optional.of( 60 );
}

}

0 comments on commit 86cac22

Please sign in to comment.