Skip to content

Commit

Permalink
move UpdatableProvider define in here
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Sep 12, 2024
1 parent 3ce6604 commit bbe9dc4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/main/golang/native/tunnel/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"time"

P "github.com/metacubex/mihomo/adapter/provider"
"github.com/metacubex/mihomo/constant/provider"
"github.com/metacubex/mihomo/log"
"github.com/metacubex/mihomo/tunnel"
Expand All @@ -20,6 +19,10 @@ type Provider struct {
UpdatedAt int64 `json:"updatedAt"`
}

type UpdatableProvider interface {
UpdatedAt() time.Time
}

func QueryProviders() []*Provider {
r := tunnel.RuleProviders()
p := tunnel.Providers()
Expand Down Expand Up @@ -47,7 +50,7 @@ func QueryProviders() []*Provider {
for _, p := range providers {
updatedAt := time.Time{}

if s, ok := p.(P.UpdatableProvider); ok {
if s, ok := p.(UpdatableProvider); ok {
updatedAt = s.UpdatedAt()
}

Expand Down

0 comments on commit bbe9dc4

Please sign in to comment.