fix(daemon): sync workspaces immediately on startup

Run syncWorkspacesFromAPI once before entering the periodic ticker
loop so newly created workspaces are discovered without the initial
30-second delay.
This commit is contained in:
Jiayuan 2026-03-30 19:32:24 +08:00
parent 25ed043117
commit 219b174819

View file

@ -283,6 +283,9 @@ func (d *Daemon) configWatchLoop(ctx context.Context) {
// and adds any new ones to the CLI config. The configWatchLoop will then
// detect the config change and register runtimes for the new workspaces.
func (d *Daemon) workspaceSyncLoop(ctx context.Context) {
// Run immediately on startup before entering the periodic loop.
d.syncWorkspacesFromAPI(ctx)
ticker := time.NewTicker(DefaultWorkspaceSyncInterval)
defer ticker.Stop()