Last active
November 2, 2017 08:18
-
-
Save mgenov/18c6faa99f95efde40a5776574b4a854 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun init(config: ServletConfig) { | |
ThreadManager.createThreadForCurrentRequest { | |
val moduleService = ModulesServiceFactory.getModulesService() | |
val module = moduleService.currentModule | |
val versionHostname = moduleService.getVersionHostname(module, moduleService.getDefaultVersion(module)) | |
val sp = versionHostname.split(".") | |
val moduleName = sp[1] | |
val appName = sp[2] | |
val targetUrl = "https://$module-dot-$appName.appspot.com/_ah/push-handlers/receive_message" | |
val pubSubService = GaePubSubService(appName) | |
pubSubService.createPushSubscription("emails", "email-service", targetUrl) | |
println("version hostname: https://$moduleName-dot-$appName.appspot.com") | |
}.start() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment