private String applyPlaceholders(String uri, SingularityDeployUpdate deployUpdate) { return uri .replaceAll("\\$REQUEST_ID", deployUpdate.getDeployMarker().getRequestId()) .replaceAll("\\$DEPLOY_ID", deployUpdate.getDeployMarker().getDeployId()); }
private String getDeployUpdateId(SingularityDeployUpdate deployUpdate) { return SingularityDeployKey.fromDeployMarker(deployUpdate.getDeployMarker()) + "-" + deployUpdate.getEventType().name(); }
private int checkDeployUpdates(SingularityWebhook webhook, List<CompletableFuture<Response>> webhookFutures) { final List<SingularityDeployUpdate> deployUpdates = webhookManager.getQueuedDeployUpdatesForHook(webhook.getId()); int numDeployUpdates = 0; for (SingularityDeployUpdate deployUpdate : deployUpdates) { String concreteUri = applyPlaceholders(webhook.getUri(), deployUpdate); webhookFutures.add(webhookSemaphore.call(() -> executeWebhookAsync( concreteUri, deployUpdate, new SingularityDeployWebhookAsyncHandler(webhookManager, webhook, deployUpdate, shouldDeleteUpdateOnFailure(numDeployUpdates, deployUpdate.getDeployMarker().getTimestamp()))) )); } return deployUpdates.size(); }
private String applyPlaceholders(String uri, SingularityDeployUpdate deployUpdate) { return uri .replaceAll("\\$REQUEST_ID", deployUpdate.getDeployMarker().getRequestId()) .replaceAll("\\$DEPLOY_ID", deployUpdate.getDeployMarker().getDeployId()); }
private String getDeployUpdateId(SingularityDeployUpdate deployUpdate) { return SingularityDeployKey.fromDeployMarker(deployUpdate.getDeployMarker()) + "-" + deployUpdate.getEventType().name(); }
private int checkDeployUpdates(SingularityWebhook webhook, List<CompletableFuture<Response>> webhookFutures) { final List<SingularityDeployUpdate> deployUpdates = webhookManager.getQueuedDeployUpdatesForHook(webhook.getId()); int numDeployUpdates = 0; for (SingularityDeployUpdate deployUpdate : deployUpdates) { String concreteUri = applyPlaceholders(webhook.getUri(), deployUpdate); webhookFutures.add(webhookSemaphore.call(() -> executeWebhookAsync( concreteUri, deployUpdate, new SingularityDeployWebhookAsyncHandler(webhookManager, webhook, deployUpdate, shouldDeleteUpdateOnFailure(numDeployUpdates, deployUpdate.getDeployMarker().getTimestamp()))) )); } return deployUpdates.size(); }