I have some Play Framework models looking similar to:
class BookieRepo @Inject()(protected val dbConfigProvider: DatabaseConfigProvider) {
val dbConfig = dbConfigProvider.get[JdbcProfile]
val db = dbConfig.db
import dbConfig.profile.api._
def all: Future[Seq[BookiesRow]] =
db.run(Bookies.result)
}
My web application runs fine and is able to use these models. However I need to invoke some 'standalone' part of my app to gather the data from websites and put it into DB. What's the recommended way to acquire access to these model's methods in my objects extending App and being started by crontab? Is StaticApplication what I need here? Doesn't it mean that I would have 2 apps (the standard one and the static one) running concurrently then?