Skip to content

Commit

Permalink
Add flag to prevent AutoDocker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens committed Apr 23, 2024
1 parent b339cb0 commit 304c540
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dbms/src/main/java/org/polypheny/db/PolyphenyDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public class PolyphenyDb {
@Option(name = { "-mode" }, description = "Special system configuration for running tests", typeConverterProvider = PolyModesConverter.class)
public static RunMode mode = RunMode.PRODUCTION;

@Option(name = { "-noAutoDocker" }, description = "Do not perform automatic setup with a local Docker instance")
public static boolean noAutoDocker = false;

@Option(name = { "-gui" }, description = "Show splash screen on startup and add taskbar gui")
public boolean desktopMode = false;

Expand Down Expand Up @@ -358,9 +361,11 @@ public void join( final long millis ) throws InterruptedException {
StatusService.initialize( transactionManager, server.getServer() );

Catalog.resetDocker = resetDocker; // TODO: Needed?
log.debug( "Setting Docker Timeouts" );
RuntimeConfig.DOCKER_TIMEOUT.setInteger( mode == RunMode.DEVELOPMENT || mode == RunMode.TEST ? 5 : RuntimeConfig.DOCKER_TIMEOUT.getInteger() );
initializeDockerManager();
if ( !noAutoDocker ) {
log.debug( "Setting Docker Timeouts" );
RuntimeConfig.DOCKER_TIMEOUT.setInteger( mode == RunMode.DEVELOPMENT || mode == RunMode.TEST ? 5 : RuntimeConfig.DOCKER_TIMEOUT.getInteger() );
performAutoSetup();
}

// Initialize plugin manager
PolyPluginManager.init( resetPlugins );
Expand Down Expand Up @@ -465,7 +470,7 @@ public void join( final long millis ) throws InterruptedException {
}


private void initializeDockerManager() {
private void performAutoSetup() {
if ( AutoDocker.getInstance().isAvailable() ) {
if ( mode == RunMode.TEST ) {
resetDocker = true;
Expand Down

0 comments on commit 304c540

Please sign in to comment.