use of org.jfrog.build.api.producerConsumer.ProducerConsumerItem in project build-info by JFrogDev.
the class NpmExtractorConsumer method consumerRun.
@Override
public void consumerRun() {
while (!Thread.interrupted()) {
try {
ProducerConsumerItem item = executor.take();
if (item == executor.TERMINATE) {
// If reached the TERMINATE NpmPackageInfo, return it to the queue and exit.
executor.put(item);
break;
}
NpmPackageInfo npmPackageInfo = (NpmPackageInfo) item;
// Try to extract sha1 and md5 for 'npmPackageInfo'. If it doesn't exist in Artifactory's cache, add it to the 'badPackages' list.
if (!appendDependency(npmPackageInfo)) {
badPackages.add(npmPackageInfo);
}
} catch (InterruptedException e) {
return;
}
}
}
use of org.jfrog.build.api.producerConsumer.ProducerConsumerItem in project build-info by JFrogDev.
the class SpecDeploymentConsumer method consumerRun.
@Override
public void consumerRun() {
while (!Thread.interrupted()) {
try {
ProducerConsumerItem item = executor.take();
if (item == executor.TERMINATE) {
// If reached the TERMINATE DeployDetails, return it to the queue and exit
executor.put(item);
break;
}
// Perform artifact deploy
ArtifactoryManager.upload((DeployDetails) item, "[" + Thread.currentThread().getName() + "]");
} catch (InterruptedException e) {
return;
} catch (IOException e) {
// Throw unchecked exception for the UncaughtExceptionHandler
throw new RuntimeException(e);
}
}
}
Aggregations