pub fn resync_controller(
block: &Block,
tab_id: &str,
rt_opts: Option<Value>,
force: bool,
broker: Option<Arc<Broker>>,
event_bus: Option<Arc<EventBus>>,
wstore: Option<Arc<WaveStore>>,
filestore: Option<Arc<FileStore>>,
) -> Result<(), String>Expand description
Resync a block’s controller — the main entry point for starting/restarting blocks.
Port of Go’s ResyncController.
Logic:
- Load block from database
- Determine controller type from meta[“controller”]
- If existing controller needs replacing (type changed, conn changed, force), stop it
- Create new controller if needed
- Start if status is init or done