resync_controller

Function resync_controller 

Source
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:

  1. Load block from database
  2. Determine controller type from meta[“controller”]
  3. If existing controller needs replacing (type changed, conn changed, force), stop it
  4. Create new controller if needed
  5. Start if status is init or done