|
|
@ -77,6 +77,8 @@ type BaseThreadState struct {
|
|
|
|
type BaseThreadStateJSON struct {
|
|
|
|
type BaseThreadStateJSON struct {
|
|
|
|
Parent *NodeID `json:"parent"`
|
|
|
|
Parent *NodeID `json:"parent"`
|
|
|
|
Children map[NodeID]interface{} `json:"children"`
|
|
|
|
Children map[NodeID]interface{} `json:"children"`
|
|
|
|
|
|
|
|
Timeout time.Time `json:"timeout"`
|
|
|
|
|
|
|
|
TimeoutAction string `json:"timeout_action"`
|
|
|
|
BaseLockableStateJSON
|
|
|
|
BaseLockableStateJSON
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -97,6 +99,8 @@ func SaveBaseThreadState(state * BaseThreadState) BaseThreadStateJSON {
|
|
|
|
return BaseThreadStateJSON{
|
|
|
|
return BaseThreadStateJSON{
|
|
|
|
Parent: parent_id,
|
|
|
|
Parent: parent_id,
|
|
|
|
Children: children,
|
|
|
|
Children: children,
|
|
|
|
|
|
|
|
Timeout: state.timeout,
|
|
|
|
|
|
|
|
TimeoutAction: state.timeout_action,
|
|
|
|
BaseLockableStateJSON: lockable_state,
|
|
|
|
BaseLockableStateJSON: lockable_state,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -122,7 +126,6 @@ func RestoreBaseThreadState(ctx * GraphContext, j BaseThreadStateJSON, loaded_no
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lockable_state._type = "thread_state"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state := BaseThreadState{
|
|
|
|
state := BaseThreadState{
|
|
|
|
BaseLockableState: *lockable_state,
|
|
|
|
BaseLockableState: *lockable_state,
|
|
|
@ -131,6 +134,8 @@ func RestoreBaseThreadState(ctx * GraphContext, j BaseThreadStateJSON, loaded_no
|
|
|
|
child_info: map[NodeID]ThreadInfo{},
|
|
|
|
child_info: map[NodeID]ThreadInfo{},
|
|
|
|
InfoType: nil,
|
|
|
|
InfoType: nil,
|
|
|
|
running: false,
|
|
|
|
running: false,
|
|
|
|
|
|
|
|
timeout: j.Timeout,
|
|
|
|
|
|
|
|
timeout_action: j.TimeoutAction,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if j.Parent != nil {
|
|
|
|
if j.Parent != nil {
|
|
|
|