mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +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",
|
||||
|
|
|
@ -81,6 +81,7 @@ public class RefreshDnsOnHostRenameAction implements Runnable {
|
|||
LeaseOptions.Builder.withCountLimit(maxLeaseCount()).leasePeriod(LEASE_MINUTES, MINUTES);
|
||||
List<TaskHandle> tasks = pullQueue.leaseTasks(options);
|
||||
if (tasks.isEmpty()) {
|
||||
response.setPayload("No DNS refresh on host rename tasks to process in pull queue.");
|
||||
return;
|
||||
}
|
||||
ImmutableList.Builder<DnsRefreshRequest> requestsBuilder = new ImmutableList.Builder<>();
|
||||
|
@ -111,10 +112,11 @@ public class RefreshDnsOnHostRenameAction implements Runnable {
|
|||
if (refreshRequests.isEmpty()) {
|
||||
logger.info(
|
||||
"No asynchronous DNS refreshes to process because all renamed hosts are deleted.");
|
||||
return;
|
||||
response.setPayload("All requested DNS refreshes are on hosts that were since deleted.");
|
||||
} else {
|
||||
logger.infofmt("Processing asynchronous DNS refresh for renamed hosts: %s", hostKeys.build());
|
||||
runMapreduce(refreshRequests, tasks);
|
||||
}
|
||||
logger.infofmt("Processing asynchronous DNS refresh for renamed hosts: %s", hostKeys.build());
|
||||
runMapreduce(refreshRequests, tasks);
|
||||
}
|
||||
|
||||
private void runMapreduce(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue