fix(tracker): save recovery in GUI thread and reduce recovery size&frequency

This commit is contained in:
5684185+vsariola@users.noreply.github.com 2023-10-02 13:34:35 +03:00
parent 905637eee3
commit 048de55f00
2 changed files with 3 additions and 3 deletions

View File

@ -158,7 +158,7 @@ func (t *Tracker) Main() {
app.Size(unit.Dp(800), unit.Dp(600)),
app.Title("Sointu Tracker"),
)
recoveryTicker := time.NewTicker(time.Second * 10)
recoveryTicker := time.NewTicker(time.Second * 30)
t.Explorer = explorer.NewExplorer(w)
var ops op.Ops
mainloop:
@ -212,7 +212,7 @@ mainloop:
e.Frame(gtx.Ops)
}
case <-recoveryTicker.C:
go t.SaveRecovery()
t.SaveRecovery()
}
}
w.Perform(system.ActionClose)

View File

@ -111,7 +111,7 @@ const (
IDParameter
)
const maxUndo = 256
const maxUndo = 64
const RECOVERY_FILE = ".sointu_recovery.yml"
func NewModel(modelMessages chan<- interface{}, playerMessages <-chan PlayerMessage) *Model {