mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-22 01:27:32 +08:00
优化代码
This commit is contained in:
@@ -5,7 +5,20 @@ type Blueprint struct {
|
||||
graphPool GraphPool
|
||||
}
|
||||
|
||||
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string) {
|
||||
bm.execPool.Load(execDefFilePath)
|
||||
bm.graphPool.Load(graphFilePath)
|
||||
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string, onRegister func(execPool *ExecPool) error) error {
|
||||
err := bm.execPool.Load(execDefFilePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = onRegister(&bm.execPool)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = bm.graphPool.Load(&bm.execPool, graphFilePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user