mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-19 07:37:29 +08:00
优化代码
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
package blueprint
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Blueprint struct {
|
||||
execPool ExecPool
|
||||
graphPool GraphPool
|
||||
}
|
||||
|
||||
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string, onRegister func(execPool *ExecPool) error) error {
|
||||
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string) error {
|
||||
err := bm.execPool.Load(execDefFilePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = onRegister(&bm.execPool)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
for _, e := range execNodes {
|
||||
if !bm.execPool.Register(e) {
|
||||
return fmt.Errorf("register exec failed,exec:%s", e.GetName())
|
||||
}
|
||||
}
|
||||
|
||||
err = bm.graphPool.Load(&bm.execPool, graphFilePath)
|
||||
|
||||
Reference in New Issue
Block a user