This is slightly linked #1741. 

In 
https://github.com/liquibase/liquibase/blob/10a0c509c59401e9351cf7d134b4bc671b5d500f/liquibase-core/src/main/java/liquibase/hub/HubUpdater.java#L364-L383

The currently held lock is released and then reacquired again. However, when using Liquibase programatically as a library the prompt is always disabled and therefore releasing and then acquiring the lock is entirely not needed.

Can I propose a change that will do

```
if (!Scope.getCurrentScope().getUI().getAllowPrompt()) {
    return;
}
```

This will solve the problem with the polluting of the logging with "Skipping auto-registration" since registering is anyways not possible when using it as a library.



┆Issue is synchronized with this [Jira Story](https://datical.atlassian.net/browse/LB-1748) by [Unito](https://www.unito.io)

}
    }
    /**
     * Determine if the Hub is not available
     *
     * @param changeLogId Changelog ID
     * @return boolean
     */
    public boolean hubIsNotAvailable(String changeLogId) {
        final HubService hubService = Scope.getCurrentScope().getSingleton(HubServiceFactory.class).getService();
        return !hubService.isOnline() || changeLogId == null;
    }
    public void syncHub(String changeLogFile, UUID hubConnectionId) throws CommandExecutionException {
        
        
        
        
        
        final CommandScope syncHub = new CommandScope("internalSyncHub")
                .addArgumentValue(InternalSyncHubCommandStep.CHANGELOG_FILE_ARG, changeLogFile)
                .addArgumentValue(InternalSyncHubCommandStep.URL_ARG, database.getConnection().getURL())
                .addArgumentValue(InternalSyncHubCommandStep.HUB_CONNECTION_ID_ARG, hubConnectionId)
                .addArgumentValue(InternalSyncHubCommandStep.CONTINUE_IF_CONNECTION_AND_PROJECT_ID_BOTH_SET_ARG, true)
                .addArgumentValue(InternalSyncHubCommandStep.DATABASE_ARG, database)
                .addArgumentValue(InternalSyncHubCommandStep.FAIL_IF_OFFLINE_ARG, false);
        try {
            syncHub.execute();
        } catch (Exception e) {
            Scope.getCurrentScope().getLog(getClass()).warning("Liquibase Hub sync failed: " + e.getMessage(), e);
        }