mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Initial work on async functions
This commit is contained in:
9
main.go
9
main.go
@@ -4,6 +4,7 @@ import (
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/iron-io/functions/api/config"
|
||||
"github.com/iron-io/functions/api/datastore"
|
||||
"github.com/iron-io/functions/api/mqs"
|
||||
"github.com/iron-io/functions/api/runner"
|
||||
"github.com/iron-io/functions/api/server"
|
||||
"github.com/spf13/viper"
|
||||
@@ -20,12 +21,18 @@ func main() {
|
||||
log.WithError(err).Fatalln("Invalid DB url.")
|
||||
}
|
||||
|
||||
mq, err := mqs.New(viper.GetString("mq"))
|
||||
if err != nil {
|
||||
log.WithError(err).Fatal("Error on init MQ")
|
||||
}
|
||||
|
||||
metricLogger := runner.NewMetricLogger()
|
||||
runner, err := runner.New(metricLogger)
|
||||
|
||||
if err != nil {
|
||||
log.WithError(err).Fatalln("Failed to create a runner")
|
||||
}
|
||||
|
||||
srv := server.New(ds, runner)
|
||||
srv := server.New(ds, mq, runner)
|
||||
srv.Run(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user