Browse Source

Describe and debug application level properties.

pull/76/head
Uldis Ansmits 5 years ago
parent
commit
8a4177b60e
  1. 7
      README.md
  2. 1
      src/main/java/com/englishtown/bitbucket/hook/MirrorBucketProcessor.java
  3. 2
      src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java

7
README.md

@ -24,3 +24,10 @@ https://bitbucket.org/atlassian/aui/src/master/src/soy/form.soy
The plugin can be found on the Atlassian Marketplace here:
https://marketplace.atlassian.com/plugins/com.englishtown.stash-hook-mirror
Plugin properties in bitbucket.properties in file, located in the shared folder of server home directory:
`plugin.com.englishtown.stash-hook-mirror.push.attempts=5
plugin.com.englishtown.stash-hook-mirror.push.threads=3
plugin.com.englishtown.stash-hook-mirror.push.timeout=120`

1
src/main/java/com/englishtown/bitbucket/hook/MirrorBucketProcessor.java

@ -49,6 +49,7 @@ public class MirrorBucketProcessor implements BucketProcessor<MirrorRequest> {
this.securityService = securityService;
timeout = Duration.ofSeconds(propertiesService.getPluginProperty(PROP_TIMEOUT, 120L));
log.debug(PROP_TIMEOUT+": "+timeout.getSeconds());
}
@Override

2
src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java

@ -78,7 +78,9 @@ public class MirrorRepositoryHook implements PostRepositoryHook<RepositoryHookRe
private BucketedExecutor<MirrorRequest> createPushExecutor(){
logger.debug("MirrorRepositoryHook: initialize pushExecutor");
int attempts = propertiesService.getPluginProperty(PROP_ATTEMPTS, 5);
logger.debug(PROP_ATTEMPTS+": "+attempts);
int threads = propertiesService.getPluginProperty(PROP_THREADS, 3);
logger.debug(PROP_THREADS+": "+threads);
return concurrencyService.getBucketedExecutor(getClass().getSimpleName(),
new BucketedExecutorSettings.Builder<>(MirrorRequest::toString, pushProcessor)
.batchSize(Integer.MAX_VALUE) // Coalesce all requests into a single push

Loading…
Cancel
Save