X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNotificationHandlerModule.kt;h=7918758f0ce7158969db1ad7c4dc02164918d125;hp=c75cbc1fa4fe89e885af1690e2823bf3be959995;hb=6d770b3aa761b4432517b4789a980c4ba75ed9fa;hpb=099242dcaceac5f53c142e400c81dd3cf0814bc6 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt index c75cbc1..7918758 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt @@ -23,7 +23,6 @@ import net.pterodactylus.sone.core.* import net.pterodactylus.sone.data.* import net.pterodactylus.sone.main.* import net.pterodactylus.sone.notify.* -import net.pterodactylus.util.notify.* import java.util.concurrent.Executors.* import java.util.function.* import javax.inject.* @@ -40,6 +39,7 @@ class NotificationHandlerModule : AbstractModule() { bind().asSingleton() bind().asSingleton() bind().asSingleton() + bind().asSingleton() } @Provides @@ -69,9 +69,8 @@ class NotificationHandlerModule : AbstractModule() { ListNotification("sones-locked-notification", "sones", loaders.loadTemplate("/templates/notify/lockedSonesNotification.html"), dismissable = true) @Provides - @Singleton - fun getSoneLockedHandler(notificationManager: NotificationManager, @Named("soneLocked") soneLockedNotification: ListNotification) = - SoneLockedHandler(notificationManager, soneLockedNotification, newScheduledThreadPool(1)) + fun getScheduledExecutorService() = + newScheduledThreadPool(1) private inline fun bind(): AnnotatedBindingBuilder = bind(T::class.java) private fun ScopedBindingBuilder.asSingleton() = `in`(Singleton::class.java)