mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 11:54:01 +03:00
Propagate DcUpdateEach setting
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package dc
|
||||
|
||||
import "time"
|
||||
|
||||
type preferIP uint8
|
||||
|
||||
const (
|
||||
@@ -12,8 +10,7 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultDC = 2
|
||||
DefaultUpdateDCAddressesEach = time.Hour
|
||||
DefaultDC = 2
|
||||
|
||||
defaultAppID = 123456
|
||||
defaultAppHash = ""
|
||||
|
||||
@@ -37,10 +37,6 @@ func (t *Telegram) GetAddresses(dc int) []Addr {
|
||||
}
|
||||
|
||||
func (t *Telegram) Run(ctx context.Context, updateEach time.Duration) {
|
||||
if updateEach == 0 {
|
||||
updateEach = DefaultUpdateDCAddressesEach
|
||||
}
|
||||
|
||||
t.update(ctx)
|
||||
|
||||
ticker := time.NewTicker(updateEach)
|
||||
|
||||
Reference in New Issue
Block a user