Skip to content

Instantly share code, notes, and snippets.

@kanuku
Last active September 3, 2015 11:32
Show Gist options
  • Save kanuku/cd656d828c5f3cc69817 to your computer and use it in GitHub Desktop.
Save kanuku/cd656d828c5f3cc69817 to your computer and use it in GitHub Desktop.
Future does not get executed.
def saveApps(input: Seq[AppInfo]) = {
logger.info(s"Apps to save:" + input.size)
db.run(this.apps ++= input).map(_ => ())
}
def appInfos(): Future[Seq[AppInfo]] = {
logger.info("Searching")
val result = db.run(apps.result)
logger.info("Found something:"+result)
result
}
def test() = {
system.scheduler.schedule(0 minutes, 15 seconds) {
logger.info("Started storing data in db")
val input = List(new AppInfo("scm_url1", "doc_url1", "spec_url1", "last_modified1"))
dataStore.saveApps(input)
dataStore.appInfos().map { x =>
logger.info("Future was executed.")
logger.info(" result = >>>>>" + x.size)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment