Reduce auto-sync delays for better UX
- Reduce flush debounce from 5s to 1s (BEADS_FLUSH_DEBOUNCE) - Reduce daemon poll interval from 10s to 2s - Makes issue changes sync much faster to JSONL and git
This commit is contained in:
@@ -29,7 +29,7 @@ var daemonCmd = &cobra.Command{
|
||||
Long: `Run a background daemon that automatically syncs issues with git remote.
|
||||
|
||||
The daemon will:
|
||||
- Poll for changes at configurable intervals (default: 10 seconds)
|
||||
- Poll for changes at configurable intervals (default: 2 seconds)
|
||||
- Export pending database changes to JSONL
|
||||
- Auto-commit changes if --auto-commit flag set
|
||||
- Auto-push commits if --auto-push flag set
|
||||
@@ -172,7 +172,7 @@ Use --health to check daemon health and metrics.`,
|
||||
}
|
||||
|
||||
func init() {
|
||||
daemonCmd.Flags().Duration("interval", 10*time.Second, "Sync check interval")
|
||||
daemonCmd.Flags().Duration("interval", 2*time.Second, "Sync check interval")
|
||||
daemonCmd.Flags().Bool("auto-commit", false, "Automatically commit changes")
|
||||
daemonCmd.Flags().Bool("auto-push", false, "Automatically push commits")
|
||||
daemonCmd.Flags().Bool("stop", false, "Stop running daemon")
|
||||
|
||||
@@ -462,12 +462,12 @@ var rootCmd = &cobra.Command{
|
||||
|
||||
// getDebounceDuration returns the auto-flush debounce duration
|
||||
// Configurable via config file or BEADS_FLUSH_DEBOUNCE env var (e.g., "500ms", "10s")
|
||||
// Defaults to 5 seconds if not set or invalid
|
||||
// Defaults to 1 second if not set or invalid
|
||||
func getDebounceDuration() time.Duration {
|
||||
duration := config.GetDuration("flush-debounce")
|
||||
if duration == 0 {
|
||||
// If parsing failed, use default
|
||||
return 5 * time.Second
|
||||
return 1 * time.Second
|
||||
}
|
||||
return duration
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user