# HG changeset patch # User Sascha L. Teichmann # Date 1548435695 -3600 # Node ID 10a1e139d2e8ec383a41ca2f1b84d5c8a6a93e27 # Parent ea0b62b7656bd237f6d365e09d631a85157f033d Imports: Re-enabled running configured imports. diff -r ea0b62b7656b -r 10a1e139d2e8 pkg/controllers/importconfig.go --- a/pkg/controllers/importconfig.go Fri Jan 25 17:54:02 2019 +0100 +++ b/pkg/controllers/importconfig.go Fri Jan 25 18:01:35 2019 +0100 @@ -16,6 +16,11 @@ import ( "database/sql" "net/http" + "strconv" + + "github.com/gorilla/mux" + + "gemma.intevation.de/gemma/pkg/imports" ) const ( @@ -74,28 +79,25 @@ conn *sql.Conn, ) (jr JSONResult, err error) { - /* + id, _ := strconv.ParseInt(mux.Vars(req)["id"], 10, 64) - id, _ := strconv.ParseInt(mux.Vars(req)["id"], 10, 64) + ctx := req.Context() - ctx := req.Context() - - var jobID int64 - if jobID, err = imports.RunConfiguredImportContext(ctx, conn, id); err != nil { - return - } + var jobID int64 + if jobID, err = imports.RunConfiguredImportContext(ctx, conn, id); err != nil { + return + } - var result = struct { - ID int64 `json:"id"` - }{ - ID: jobID, - } + var result = struct { + ID int64 `json:"id"` + }{ + ID: jobID, + } - jr = JSONResult{ - Code: http.StatusCreated, - Result: &result, - } - */ + jr = JSONResult{ + Code: http.StatusCreated, + Result: &result, + } return } diff -r ea0b62b7656b -r 10a1e139d2e8 pkg/imports/config.go --- a/pkg/imports/config.go Fri Jan 25 17:54:02 2019 +0100 +++ b/pkg/imports/config.go Fri Jan 25 18:01:35 2019 +0100 @@ -36,7 +36,7 @@ ImportConfigOut struct { ID int64 `json:"id"` Kind ImportKind `json:"kind"` - Config interface{} `json:"config"` + Config interface{} `json:"config,omitempty"` } PersistentConfig struct {