Skip to content

Instantly share code, notes, and snippets.

@penguinbroker
Last active August 29, 2015 14:20
Show Gist options
  • Save penguinbroker/80fc8cb0253d0961120a to your computer and use it in GitHub Desktop.
Save penguinbroker/80fc8cb0253d0961120a to your computer and use it in GitHub Desktop.
init pubnub channels
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