feat: harden loose-offline sync for user JWT, schema, and console ops
Enable Binding-scoped agent push/pull, empty-table schema ensure, SyncPage inspect/drop-table, default module import, and agent-bound publish docs from the 宇恒联调意见. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -55,6 +55,12 @@ func (m *Manager) StartChannel(id string) error {
|
||||
c.Enabled = true
|
||||
c.LastError = ""
|
||||
})
|
||||
// 预热 remote,避免首个 agent push 冷开 SQLite 触发超时
|
||||
go func(driver Driver, dsn string) {
|
||||
if err := WarmRemote(driver, dsn); err != nil {
|
||||
log.Printf("dbsync warm remote %s: %v", id, err)
|
||||
}
|
||||
}(ch.Remote.Driver, ch.Remote.DSN)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -65,6 +71,9 @@ func (m *Manager) StopChannel(id string) {
|
||||
cancel()
|
||||
delete(m.runners, id)
|
||||
}
|
||||
if ch, err := m.store.GetChannel(id); err == nil {
|
||||
InvalidateRemote(ch.Remote.Driver, ch.Remote.DSN)
|
||||
}
|
||||
_ = m.store.PatchStats(id, func(c *Channel) { c.Enabled = false })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user