Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
scm_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3b26bc2c
authored
May 15, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化
parent
d10cc5f6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
6 deletions
conf/config.ini → conf/config_production.ini
configs/config.go
main.go
pull_scm_server.bash
conf/config.ini
→
conf/config
_production
.ini
View file @
3b26bc2c
File moved
configs/config.go
View file @
3b26bc2c
package
configs
package
configs
import
(
import
(
"fmt"
"gopkg.in/ini.v1"
"gopkg.in/ini.v1"
"os"
"os"
)
)
var
Cfg
*
ini
.
File
var
Cfg
*
ini
.
File
func
init
()
{
//func init() {
// var err error
// Cfg, err = ini.Load("conf/config.ini")
// if err != nil {
// fmt.Printf("Fail to read file: %v", err)
// os.Exit(1)
// }
//}
func
Setup
(
path
string
){
var
err
error
var
err
error
Cfg
,
err
=
ini
.
Load
(
"conf/config.ini"
)
Cfg
,
err
=
ini
.
Load
(
path
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
"Fail to read file: %v"
,
err
)
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
}
}
...
...
main.go
View file @
3b26bc2c
package
main
package
main
import
(
import
(
"flag"
"scm_server/cmd/queue/sync_audit_status"
"scm_server/cmd/queue/sync_audit_status"
"scm_server/cmd/queue/sync_customer"
"scm_server/cmd/queue/sync_customer"
"scm_server/cmd/queue/sync_goods"
"scm_server/cmd/queue/sync_goods"
...
@@ -44,8 +45,6 @@ func pushAlive() {
...
@@ -44,8 +45,6 @@ func pushAlive() {
}
}
payload
=
append
(
payload
,
item
)
payload
=
append
(
payload
,
item
)
param
:=
req
.
BodyJSON
(
&
payload
)
param
:=
req
.
BodyJSON
(
&
payload
)
//temp,_:=json.Marshal(payload)
//fmt.Println(string(temp))
req
.
Debug
=
false
req
.
Debug
=
false
url
=
configs
.
OpenFalconPushUrl
url
=
configs
.
OpenFalconPushUrl
_
,
err
=
req
.
Post
(
url
,
param
)
_
,
err
=
req
.
Post
(
url
,
param
)
...
@@ -54,6 +53,16 @@ func pushAlive() {
...
@@ -54,6 +53,16 @@ func pushAlive() {
}
}
}
}
var
(
ConfFile
string
// 配置文件路径
)
func
init
()
{
// master -config ./conf/config.ini
flag
.
StringVar
(
&
ConfFile
,
"config"
,
"./conf/config.ini"
,
"./conf/config.ini"
)
flag
.
Parse
()
}
func
main
()
{
func
main
()
{
go
sync_customer
.
Sync
()
go
sync_customer
.
Sync
()
go
sync_supplier
.
Sync
()
go
sync_supplier
.
Sync
()
...
...
pull_scm_server.bash
View file @
3b26bc2c
...
@@ -3,6 +3,8 @@ cd /data2/gocode/scm_server
...
@@ -3,6 +3,8 @@ cd /data2/gocode/scm_server
git pull origin master
git pull origin master
rm ./sh/scm_wms_sync
rm ./sh/scm_wms_sync
rm ./sh/import_source
rm ./sh/import_source
rm ./conf/config.ini
mv ./conf/config_production.ini ./conf/config.ini
go build
-o
./sh/scm_wms_sync ./main.go
go build
-o
./sh/scm_wms_sync ./main.go
go build
-o
./sh/import_source ./cmd/source/main.go
go build
-o
./sh/import_source ./cmd/source/main.go
supervisorctl restart scm:scm_server
supervisorctl restart scm:scm_server
\ No newline at end of file
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