Skip to content

Commit

Permalink
feat: make worklog items sync faster
Browse files Browse the repository at this point in the history
  • Loading branch information
dhth committed Apr 3, 2024
1 parent 5df7247 commit 1c73ba6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const (
func setupDB(dbpath string) (*sql.DB, error) {

db, err := sql.Open("sqlite", dbpath)
db.SetMaxOpenConns(1)
db.SetMaxIdleConns(1)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion ui/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
cmds = append(cmds, fetchJIRAIssues(m.jiraClient, m.jql))
case WorklogView:
cmds = append(cmds, fetchLogEntries(m.db))
m.worklogList.ResetSelected()
}
case "ctrl+s":
if m.activeView == IssueListView {
Expand Down Expand Up @@ -230,7 +231,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}
}
return m, tea.Sequence(cmds...)
}
case "?":
m.lastView = m.activeView
Expand Down

0 comments on commit 1c73ba6

Please sign in to comment.