Skip to content

Commit

Permalink
Fixng a bad merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
sduskis committed Apr 18, 2019
1 parent 6be9e3d commit 7487e88
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ private ApiFuture<PublishResponse> publishCall(OutstandingBatch outstandingBatch
return publisherStub.publishCallable().futureCall(publishRequest.build());
}


private void publishOutstandingBatch(final OutstandingBatch outstandingBatch) {
final ApiFutureCallback<PublishResponse> futureCallback =
new ApiFutureCallback<PublishResponse>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,25 +232,25 @@ public void run() {
}
});
}
}

/** Cancels every task in the queue assoicated with {@code key}. */
void cancelQueuedTasks(final String key, Throwable e) {
// TODO(kimkyung-goog): Ensure execute() fails once cancelQueueTasks() has been ever invoked,
// so that no more tasks are scheduled.
synchronized (tasksByKey) {
final Deque<Runnable> tasks = tasksByKey.get(key);
if (tasks == null) {
return;
}
while (!tasks.isEmpty()) {
Runnable task = tasks.poll();
if (task instanceof CancellableRunnable) {
((CancellableRunnable) task).cancel(e);
} else {
logger.log(
Level.WARNING,
"Attempted to cancel Runnable that was not CancellableRunnable; ignored.");
/** Cancels every task in the queue assoicated with {@code key}. */
void cancelQueuedTasks(final String key, Throwable e) {
// TODO(kimkyung-goog): Ensure execute() fails once cancelQueueTasks() has been ever invoked,
// so that no more tasks are scheduled.
synchronized (tasksByKey) {
final Deque<Runnable> tasks = tasksByKey.get(key);
if (tasks == null) {
return;
}
while (!tasks.isEmpty()) {
Runnable task = tasks.poll();
if (task instanceof CancellableRunnable) {
((CancellableRunnable) task).cancel(e);
} else {
logger.log(
Level.WARNING,
"Attempted to cancel Runnable that was not CancellableRunnable; ignored.");
}
}
}
}
Expand Down

0 comments on commit 7487e88

Please sign in to comment.