refactor runner

This commit is contained in:
Pedro Nasser
2016-08-21 19:40:08 -03:00
parent 3b5ff970df
commit 8b0d0f1e13
11 changed files with 114 additions and 88 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/iron-io/functions/api/config"
"github.com/iron-io/functions/api/datastore"
"github.com/iron-io/functions/api/models"
"github.com/iron-io/functions/api/runner"
"github.com/iron-io/functions/api/server"
"github.com/spf13/viper"
"golang.org/x/net/context"
@@ -26,6 +27,11 @@ func main() {
log.WithError(err).Fatalln("Invalid DB url.")
}
srv := server.New(ds, c)
runner, err := runner.New()
if err != nil {
log.WithError(err).Fatalln("Failed to create a runner")
}
srv := server.New(c, ds, runner)
srv.Run(ctx)
}