Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SooonerHotel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴贤德
SooonerHotel
Commits
140a3dc1
Commit
140a3dc1
authored
Sep 12, 2019
by
吴贤德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中心服务:修复不自动更新站点配置问题
parent
b059c973
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
Request.go
Services/CenterService/Common/Request/Request.go
+1
-1
ConfigChecker.go
Services/CenterService/Controller/ConfigChecker.go
+16
-0
config.ini
Services/CenterService/config.ini
+8
-0
No files found.
Services/CenterService/Common/Request/Request.go
View file @
140a3dc1
...
...
@@ -39,7 +39,7 @@ func Post(url string, jsonBody string) (string, error) {
func
Get
(
url
string
)
(
string
,
error
)
{
//log.Infoln("request : ",url)
//req.Debug =
fals
e
//req.Debug =
tru
e
req
.
SetFlags
(
req
.
LstdFlags
|
req
.
Lcost
)
req
.
SetTimeout
(
time
.
Duration
(
60
)
*
time
.
Second
)
...
...
Services/CenterService/Controller/ConfigChecker.go
View file @
140a3dc1
...
...
@@ -12,6 +12,7 @@ type ConfigChecker struct {
func
(
this
*
ConfigChecker
)
Start
()
{
this
.
startSysConfigChecker
()
this
.
startSpsConfigChecker
()
this
.
startSitesConfigChecker
()
}
func
(
this
*
ConfigChecker
)
startSysConfigChecker
()
{
...
...
@@ -41,3 +42,17 @@ func (this *ConfigChecker) startSpsConfigChecker() {
goto
START
}()
}
func
(
this
*
ConfigChecker
)
startSitesConfigChecker
()
{
config
:=
Config
.
GetInstance
()
go
func
()
{
START
:
s
,
ok
:=
config
.
Sys
.
Get
(
"config_sp_check_seconds"
)
if
ok
{
n
:=
Unit
.
Time2Seconds
(
s
.
(
string
))
time
.
Sleep
(
time
.
Duration
(
n
)
*
time
.
Second
)
config
.
InitSitesConfig
()
}
goto
START
}()
}
\ No newline at end of file
Services/CenterService/config.ini
View file @
140a3dc1
[local]
api_conf_sys
=
http://192.168.199.104:801/api/center/conf_sys
api_conf_sps
=
http://192.168.199.104:801/api/center/conf_sps
api_conf_sites
=
http://192.168.199.104:801/api/center/conf_sites
api_tb_playlog_create
=
http://192.168.199.104:801/api/center/tb_playlog_create
log_path
=
./
log_filename
=
center_service.log
[debug]
api_conf_sys
=
http://192.168.200.134:801/api/center/conf_sys
api_conf_sps
=
http://192.168.200.134:801/api/center/conf_sps
...
...
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