Skip to content

Commit

Permalink
Add logs (#9882)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmoriceau authored Jan 28, 2022
1 parent d566369 commit 028d0e2
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ public class ConnectionManagerWorkflowImpl implements ConnectionManagerWorkflow

private CancellationScope syncWorkflowCancellationScope;

private UUID connectionId;

public ConnectionManagerWorkflowImpl() {}

@Override
public void run(final ConnectionUpdaterInput connectionUpdaterInput) throws RetryableException {
connectionId = connectionUpdaterInput.getConnectionId();
try {
if (connectionUpdaterInput.getWorkflowState() != null) {
workflowState = connectionUpdaterInput.getWorkflowState();
Expand Down Expand Up @@ -244,7 +247,7 @@ private void reportFailure(final ConnectionUpdaterInput connectionUpdaterInput)
} else {
jobCreationAndStatusUpdateActivity.jobFailure(new JobFailureInput(
connectionUpdaterInput.getJobId(),
"Job failed after too many retries"));
"Job failed after too many retries for connection " + connectionId));

Workflow.await(Duration.ofMinutes(1), () -> skipScheduling());

Expand All @@ -261,7 +264,7 @@ private void resetNewConnectionInput(final ConnectionUpdaterInput connectionUpda
@Override
public void submitManualSync() {
if (workflowState.isRunning()) {
log.info("Can't schedule a manual workflow if a sync is running for this connection");
log.info("Can't schedule a manual workflow if a sync is running for connection {}", connectionId);
return;
}

Expand All @@ -271,7 +274,7 @@ public void submitManualSync() {
@Override
public void cancelJob() {
if (!workflowState.isRunning()) {
log.info("Can't cancel a non-running sync");
log.info("Can't cancel a non-running sync for connection {}", connectionId);
return;
}
workflowState.setCancelled(true);
Expand Down

0 comments on commit 028d0e2

Please sign in to comment.