Last active
August 29, 2015 14:20
-
-
Save penguinbroker/80fc8cb0253d0961120a to your computer and use it in GitHub Desktop.
init pubnub channels
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
val users = Await.result(ComponentRegistry.institutionUserDao.tableScan, 100.seconds) | |
users map { user => | |
if (user.pubnubAuthKey.isEmpty) { | |
println(s"updating user ${user.id}") | |
val updated = user.withAuthKey(echo360.util.IdGenerator.createUuid) | |
Await.result(ComponentRegistry.institutionUserDao.update(updated), 10.seconds) | |
Thread.sleep(10) | |
} | |
} | |
val users = Await.result(ComponentRegistry.institutionUserDao.tableScan, 100.seconds) | |
users map { user => | |
Await.result(ComponentRegistry.mediaInteractionService.initUserChannel(user), 10.seconds) | |
Thread.sleep(1) | |
} | |
val sections = Await.result(ComponentRegistry.sectionDao.tableScan, 100.seconds) | |
sections map { section => | |
Await.result(ComponentRegistry.sectionInteractionService.initSectionChannels(section), 10.seconds) | |
Thread.sleep(10) | |
} | |
val userSections = Await.result(ComponentRegistry.userSectionDao.tableScan, 100.seconds) | |
userSections map { userSection => | |
println(userSection.userId) | |
Await.result(ComponentRegistry.sectionInteractionService.authorizeUser(userSection), 10.seconds) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment