mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add tool to check if other requests are still running
This is needed for the Lock.java enhancement where a lock will be implicitly released if the request owning it dies. No matter which solution we want for refactoring the Lock itself, we will need this class. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=167600314
This commit is contained in:
parent
18a13a09a4
commit
fa70bd272a
5 changed files with 164 additions and 10 deletions
|
@ -20,7 +20,6 @@ import static google.registry.request.RequestParameters.extractRequiredParameter
|
|||
|
||||
import com.google.api.services.bigquery.model.TableFieldSchema;
|
||||
import com.google.appengine.api.taskqueue.Queue;
|
||||
import com.google.apphosting.api.ApiProxy;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dagger.Module;
|
||||
|
@ -28,6 +27,7 @@ import dagger.Provides;
|
|||
import dagger.multibindings.IntoMap;
|
||||
import dagger.multibindings.StringKey;
|
||||
import google.registry.request.Parameter;
|
||||
import google.registry.request.RequestLogId;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.UUID;
|
||||
import javax.inject.Named;
|
||||
|
@ -39,8 +39,6 @@ import javax.servlet.http.HttpServletRequest;
|
|||
@Module
|
||||
public class WhiteboxModule {
|
||||
|
||||
private static final String REQUEST_LOG_ID = "com.google.appengine.runtime.request_log_id";
|
||||
|
||||
@Provides
|
||||
@IntoMap
|
||||
@StringKey(EppMetric.TABLE_ID)
|
||||
|
@ -71,16 +69,10 @@ public class WhiteboxModule {
|
|||
};
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("requestLogId")
|
||||
static String provideRequestLogId() {
|
||||
return ApiProxy.getCurrentEnvironment().getAttributes().get(REQUEST_LOG_ID).toString();
|
||||
}
|
||||
|
||||
/** Provides an EppMetric builder with the request ID and startTimestamp already initialized. */
|
||||
@Provides
|
||||
static EppMetric.Builder provideEppMetricBuilder(
|
||||
@Named("requestLogId") String requestLogId, Clock clock) {
|
||||
@RequestLogId String requestLogId, Clock clock) {
|
||||
return EppMetric.builderForRequest(requestLogId, clock);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue