mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Add human-readable responses when manually running batch []s
This will make potential issues a little nicer to debug in the future, because the person hitting these endpoints manually will immediately know why they may not be kicking off a [] console as might be expected. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=134840223
This commit is contained in:
parent
6785ce277a
commit
3613eff204
2 changed files with 7 additions and 3 deletions
|
@ -114,6 +114,7 @@ public class DeleteContactsAndHostsAction implements Runnable {
|
|||
LeaseOptions.Builder.withCountLimit(maxLeaseCount()).leasePeriod(LEASE_MINUTES, MINUTES);
|
||||
List<TaskHandle> tasks = queue.leaseTasks(options);
|
||||
if (tasks.isEmpty()) {
|
||||
response.setPayload("No contact/host deletion tasks in pull queue.");
|
||||
return;
|
||||
}
|
||||
Multiset<String> kindCounts = HashMultiset.create(2);
|
||||
|
@ -143,6 +144,7 @@ public class DeleteContactsAndHostsAction implements Runnable {
|
|||
ImmutableList<DeletionRequest> deletionRequests = builder.build();
|
||||
if (deletionRequests.isEmpty()) {
|
||||
logger.info("No asynchronous deletions to process because all were already handled.");
|
||||
response.setPayload("All requested deletions of contacts/hosts have already occurred.");
|
||||
} else {
|
||||
logger.infofmt(
|
||||
"Processing asynchronous deletion of %d contacts and %d hosts: %s",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue