From d043d926ebadf4bbd7e819a635e4ce9ba29a34a9 Mon Sep 17 00:00:00 2001 From: Licoy Date: Tue, 21 Jun 2022 21:14:54 +0800 Subject: [PATCH] fix: ticker unit --- go.mod | 3 +-- go.sum | 3 --- gui.go | 6 +++++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1d4db57..41e2dc6 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.18 require ( fyne.io/fyne/v2 v2.2.1 + github.com/getlantern/elevate v0.0.0-20210901195629-ce58359e4d0e github.com/jessevdk/go-flags v1.5.0 github.com/spf13/viper v1.12.0 ) @@ -18,7 +19,6 @@ require ( github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 // indirect github.com/getlantern/byteexec v0.0.0-20170405023437-4cfb26ec74f4 // indirect github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 // indirect - github.com/getlantern/elevate v0.0.0-20210901195629-ce58359e4d0e // indirect github.com/getlantern/errors v0.0.0-20190325191628-abdb3e3e36f7 // indirect github.com/getlantern/filepersist v0.0.0-20160317154340-c5f0cd24e799 // indirect github.com/getlantern/golog v0.0.0-20190830074920-4ef2e798c2d7 // indirect @@ -33,7 +33,6 @@ require ( github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect - github.com/lu4p/go-escalate v0.0.0-20200507153608-2d90c2953bff // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect diff --git a/go.sum b/go.sum index b41fd50..d2aff61 100644 --- a/go.sum +++ b/go.sum @@ -238,8 +238,6 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/lu4p/go-escalate v0.0.0-20200507153608-2d90c2953bff h1:X5uKHG56mUo723TzAljeuHG/354GynJZt1qf1ZWhiEo= -github.com/lu4p/go-escalate v0.0.0-20200507153608-2d90c2953bff/go.mod h1:Iyfvxe8Bv2dq0BMTnYKgBCy3h5Vl6Z9+9kG50NErf74= github.com/lucor/goinfo v0.0.0-20210802170112-c078a2b0f08b/go.mod h1:PRq09yoB+Q2OJReAmwzKivcYyremnibWGbK7WfftHzc= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= @@ -489,7 +487,6 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/gui.go b/gui.go index 633e109..e829294 100644 --- a/gui.go +++ b/gui.go @@ -106,7 +106,11 @@ func getLogoResource() fyne.Resource { } func getTicker(interval int) *time.Ticker { - return time.NewTicker(time.Second * time.Duration(interval)) + d := time.Minute + if IsDebug() { + d = time.Second + } + return time.NewTicker(d * time.Duration(interval)) } func guiClientMode() (content fyne.CanvasObject) {