Change metrics ThreadFactory to produce daemon threads

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=156106183
This commit is contained in:
shikhman 2017-05-15 14:41:17 -07:00 committed by Ben McIlwain
parent 5ff56ac7a0
commit e1f4df86bd

View file

@ -24,6 +24,7 @@ import com.google.appengine.api.ThreadManager;
import com.google.appengine.api.modules.ModulesService;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import dagger.Module;
import dagger.Provides;
import google.registry.config.RegistryConfig.Config;
@ -87,7 +88,10 @@ public final class StackdriverModule {
@Provides
@Named("metricsBackgroundThreadFactory")
static ThreadFactory provideThreadFactory() {
return ThreadManager.backgroundThreadFactory();
return new ThreadFactoryBuilder()
.setThreadFactory(ThreadManager.backgroundThreadFactory())
.setDaemon(true)
.build();
}
@Provides