Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
985133f1
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
985133f1
编写于
8月 09, 2019
作者:
Y
yangrui07
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cube agent code format
上级
3da70904
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
32 addition
and
32 deletion
+32
-32
cube/cube-agent/src/agent/http.go
cube/cube-agent/src/agent/http.go
+10
-10
cube/cube-agent/src/agent/http_get.go
cube/cube-agent/src/agent/http_get.go
+5
-5
cube/cube-agent/src/agent/http_post.go
cube/cube-agent/src/agent/http_post.go
+4
-4
cube/cube-agent/src/agent/util.go
cube/cube-agent/src/agent/util.go
+6
-6
cube/cube-agent/src/agent/work.go
cube/cube-agent/src/agent/work.go
+5
-5
cube/cube-agent/src/agent/work_pool.go
cube/cube-agent/src/agent/work_pool.go
+1
-1
cube/cube-agent/src/cube-agent.go
cube/cube-agent/src/cube-agent.go
+1
-1
未找到文件。
cube/cube-agent/src/agent/http.go
浏览文件 @
985133f1
...
...
@@ -100,7 +100,7 @@ func handleRest(w http.ResponseWriter, r *http.Request) {
if
isJsonDict
(
s
)
{
fmt
.
Fprintln
(
w
,
s
)
}
else
{
}
else
{
logex
.
Fatalf
(
"invalid json: %v"
,
s
)
}
...
...
@@ -128,7 +128,7 @@ func parseHttpKv(r *http.Request) map[string]string {
}
// allow passing hostname for debug
if
_
,
ok
:=
m
[
"hostname"
];
!
ok
{
if
_
,
ok
:=
m
[
"hostname"
];
!
ok
{
ip
:=
r
.
RemoteAddr
[
:
strings
.
Index
(
r
.
RemoteAddr
,
":"
)]
m
[
"hostname"
],
_
=
getHostname
(
ip
)
}
...
...
cube/cube-agent/src/agent/http_get.go
浏览文件 @
985133f1
...
...
@@ -2,8 +2,8 @@
package
agent
import
(
"fmt"
"encoding/json"
"fmt"
)
func
initGetHandlers
()
{
...
...
@@ -13,7 +13,7 @@ func initGetHandlers() {
}
func
GetStatus
(
subpath
string
,
m
map
[
string
]
string
,
b
[]
byte
)
(
string
,
string
,
error
)
{
b
,
err
:=
json
.
Marshal
(
BUILTIN_STATUS
)
;
b
,
err
:=
json
.
Marshal
(
BUILTIN_STATUS
)
if
err
!=
nil
{
return
quote
(
""
),
""
,
fmt
.
Errorf
(
"json marshal failed, %v"
,
err
)
}
...
...
cube/cube-agent/src/agent/http_post.go
浏览文件 @
985133f1
...
...
@@ -2,8 +2,8 @@
package
agent
import
(
"fmt"
"encoding/json"
"fmt"
"github.com/Badangel/logex"
)
...
...
cube/cube-agent/src/agent/util.go
浏览文件 @
985133f1
cube/cube-agent/src/agent/work.go
浏览文件 @
985133f1
...
...
@@ -417,7 +417,7 @@ func (work *Work) CheckToReload() bool {
}
func
(
work
*
Work
)
Reload
()
(
err
error
)
{
if
(
work
.
Port
==
""
)
{
if
work
.
Port
==
""
{
err
=
errors
.
New
(
"Reload with invalid port."
)
return
}
...
...
@@ -632,7 +632,7 @@ func (work *Work) Pop() (err error) {
func
writeStateFile
(
dictName
string
,
shardSeq
int
,
service
,
state
string
)
{
stateFile
:=
fmt
.
Sprintf
(
".state_%s_%d"
,
dictName
,
shardSeq
)
if
service
!=
""
{
stateFile
=
stateFile
+
"_"
+
service
;
stateFile
=
stateFile
+
"_"
+
service
}
cmd
:=
fmt
.
Sprintf
(
"echo '%s' > %s/state/%s"
,
state
,
Dir
,
stateFile
)
...
...
@@ -644,7 +644,7 @@ func writeStateFile(dictName string, shardSeq int, service, state string) {
func
RemoveStateFile
(
dictName
string
,
shardSeq
int
,
service
string
)
{
stateFile
:=
fmt
.
Sprintf
(
".state_%s_%d"
,
dictName
,
shardSeq
)
if
service
!=
""
{
stateFile
=
stateFile
+
"_"
+
service
;
stateFile
=
stateFile
+
"_"
+
service
}
cmd
:=
fmt
.
Sprintf
(
"rm -f %s/state/%s"
,
Dir
,
stateFile
)
...
...
cube/cube-agent/src/agent/work_pool.go
浏览文件 @
985133f1
...
...
@@ -3,8 +3,8 @@ package agent
import
(
"errors"
"fmt"
"sync/atomic"
"sync"
"sync/atomic"
)
type
(
...
...
cube/cube-agent/src/cube-agent.go
浏览文件 @
985133f1
...
...
@@ -3,8 +3,8 @@ package main
import
(
"agent"
"fmt"
"github.com/docopt/docopt-go"
"github.com/Badangel/logex"
"github.com/docopt/docopt-go"
"os"
"path/filepath"
"runtime"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录