mirror of
https://github.com/Snawoot/opera-proxy.git
synced 2025-09-02 02:30:21 +00:00
fmt
This commit is contained in:
parent
ed153de1d0
commit
ddc27f34ab
3 changed files with 25 additions and 25 deletions
2
main.go
2
main.go
|
@ -208,7 +208,7 @@ func run() int {
|
|||
}
|
||||
cl()
|
||||
|
||||
runTicker(context.Background(), args.refresh, func (ctx context.Context) {
|
||||
runTicker(context.Background(), args.refresh, func(ctx context.Context) {
|
||||
mainLogger.Info("Refreshing login...")
|
||||
loginCtx, cl := context.WithTimeout(ctx, args.timeout)
|
||||
defer cl()
|
||||
|
|
6
utils.go
6
utils.go
|
@ -158,11 +158,11 @@ func AfterWallClock(d time.Duration) <-chan time.Time {
|
|||
for {
|
||||
select {
|
||||
case t = <-after_ch:
|
||||
ch <-t
|
||||
ch <- t
|
||||
return
|
||||
case t = <-ticker.C:
|
||||
if t.After(deadline) {
|
||||
ch <-t
|
||||
ch <- t
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ func AfterWallClock(d time.Duration) <-chan time.Time {
|
|||
return ch
|
||||
}
|
||||
|
||||
func runTicker(ctx context.Context, interval time.Duration, cb func (context.Context)) {
|
||||
func runTicker(ctx context.Context, interval time.Duration, cb func(context.Context)) {
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
|
|
Loading…
Add table
Reference in a new issue