@@ -24,7 +24,6 @@ import (
24
24
25
25
const (
26
26
intervalToExpire = 10 * time .Minute
27
- defaultIntervalToUpdateDb = 30 * time .Second
28
27
defaultIntervalToShowBreakReminder = 80 * time .Minute
29
28
defaultIntervalToRepeatBreakReminder = 10 * time .Minute
30
29
defaultTpl = "{{if .Active}}☭{{else}}☯{{end}} {{.FormatLabel}}"
@@ -221,11 +220,6 @@ func newCmd(db *sqlx.DB) error {
221
220
Usage : "Update the duration for current activity and run hook if specified" ,
222
221
ArgsUsage : " " ,
223
222
Flags : []cli.Flag {
224
- & cli.DurationFlag {
225
- Name : "update-interval" ,
226
- Usage : "interval to update activity time in db" ,
227
- Value : defaultIntervalToUpdateDb ,
228
- },
229
223
& cli.DurationFlag {
230
224
Name : "break-interval" ,
231
225
Usage : "interval to show a break reminder" ,
@@ -246,12 +240,11 @@ func newCmd(db *sqlx.DB) error {
246
240
return cli .ShowSubcommandHelp (cCtx )
247
241
}
248
242
249
- intervalToUpdateDb := cCtx .Duration ("update-interval" )
250
243
intervalToShowBreakReminder := cCtx .Duration ("break-interval" )
251
244
intervalToRepeatBreakReminder := cCtx .Duration ("repeat-interval" )
252
245
hook := cCtx .String ("hook" )
253
246
254
- err := Daemon (db , intervalToUpdateDb , intervalToShowBreakReminder , intervalToRepeatBreakReminder , hook )
247
+ err := Daemon (db , intervalToShowBreakReminder , intervalToRepeatBreakReminder , hook )
255
248
if err != nil {
256
249
return err
257
250
}
@@ -488,7 +481,6 @@ func Show(db *sqlx.DB, tpl string) error {
488
481
// Daemon updates the duration of current activity and runs the hook if specified
489
482
func Daemon (
490
483
db * sqlx.DB ,
491
- intervalToUpdateDb time.Duration ,
492
484
intervalToShowBreakReminder time.Duration ,
493
485
intervalToRepeatBreakReminder time.Duration ,
494
486
hook string ,
@@ -550,7 +542,7 @@ func Daemon(
550
542
log .Println ("change" , c )
551
543
552
544
case <- time .After (nextUpdate ):
553
- if activity .Active () && time .Since (activity .Updated ()) > intervalToUpdateDb {
545
+ if activity .Active () && time .Since (activity .Updated ()) > time . Minute {
554
546
fmt .Printf ("updating time for %s\n " , activity .Name )
555
547
_ , err := UpdateIfExists (db , "" , false )
556
548
if err != nil {
0 commit comments