Start/restart poll job when created or updated
This currently contains the logic for restarting updated jobs, but nothing exercises this logic. The logic for starting polling for a newly created pipeline is implemented.
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
var log = logging.MustGetLogger("cursorius-server")
|
||||
|
||||
func createSchema(db database.Database) (graphql.Schema, error) {
|
||||
func createSchema(db database.Database, pollChan chan uuid.UUID) (graphql.Schema, error) {
|
||||
runnerType := graphql.NewObject(graphql.ObjectConfig{
|
||||
Name: "Runner",
|
||||
Description: "A runner available for use inside of a pipeline.",
|
||||
@@ -454,6 +454,8 @@ func createSchema(db database.Database) (graphql.Schema, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pollChan <- pipeline.Id
|
||||
|
||||
return pipeline, nil
|
||||
},
|
||||
},
|
||||
@@ -681,9 +683,9 @@ func createSchema(db database.Database) (graphql.Schema, error) {
|
||||
return schema, nil
|
||||
}
|
||||
|
||||
func CreateHandler(db database.Database, mux *http.ServeMux) error {
|
||||
func CreateHandler(db database.Database, pollChan chan uuid.UUID, mux *http.ServeMux) error {
|
||||
|
||||
schema, err := createSchema(db)
|
||||
schema, err := createSchema(db, pollChan)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user