Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
25de94e2
authored
Oct 29, 2025
by
Seefs
Committed by
GitHub
Oct 28, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: test channel frequency (#2119)
parent
7b838d64
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
controller/channel-test.go
+1
-1
setting/operation_setting/monitor_setting.go
+2
-2
No files found.
controller/channel-test.go
View file @
25de94e2
...
@@ -625,7 +625,7 @@ func AutomaticallyTestChannels() {
...
@@ -625,7 +625,7 @@ func AutomaticallyTestChannels() {
}
}
for
{
for
{
frequency
:=
operation_setting
.
GetMonitorSetting
()
.
AutoTestChannelMinutes
frequency
:=
operation_setting
.
GetMonitorSetting
()
.
AutoTestChannelMinutes
time
.
Sleep
(
time
.
Duration
(
frequency
)
*
time
.
Minute
)
time
.
Sleep
(
time
.
Duration
(
int
(
math
.
Round
(
frequency
))
)
*
time
.
Minute
)
common
.
SysLog
(
fmt
.
Sprintf
(
"automatically test channels with interval %d minutes"
,
frequency
))
common
.
SysLog
(
fmt
.
Sprintf
(
"automatically test channels with interval %d minutes"
,
frequency
))
common
.
SysLog
(
"automatically testing all channels"
)
common
.
SysLog
(
"automatically testing all channels"
)
_
=
testAllChannels
(
false
)
_
=
testAllChannels
(
false
)
...
...
setting/operation_setting/monitor_setting.go
View file @
25de94e2
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
type
MonitorSetting
struct
{
type
MonitorSetting
struct
{
AutoTestChannelEnabled
bool
`json:"auto_test_channel_enabled"`
AutoTestChannelEnabled
bool
`json:"auto_test_channel_enabled"`
AutoTestChannelMinutes
int
`json:"auto_test_channel_minutes"`
AutoTestChannelMinutes
float64
`json:"auto_test_channel_minutes"`
}
}
// 默认配置
// 默认配置
...
@@ -28,7 +28,7 @@ func GetMonitorSetting() *MonitorSetting {
...
@@ -28,7 +28,7 @@ func GetMonitorSetting() *MonitorSetting {
frequency
,
err
:=
strconv
.
Atoi
(
os
.
Getenv
(
"CHANNEL_TEST_FREQUENCY"
))
frequency
,
err
:=
strconv
.
Atoi
(
os
.
Getenv
(
"CHANNEL_TEST_FREQUENCY"
))
if
err
==
nil
&&
frequency
>
0
{
if
err
==
nil
&&
frequency
>
0
{
monitorSetting
.
AutoTestChannelEnabled
=
true
monitorSetting
.
AutoTestChannelEnabled
=
true
monitorSetting
.
AutoTestChannelMinutes
=
f
requency
monitorSetting
.
AutoTestChannelMinutes
=
f
loat64
(
frequency
)
}
}
}
}
return
&
monitorSetting
return
&
monitorSetting
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment