Skip to content

Commit

Permalink
Merge pull request #26 from PKUHPC/update_port
Browse files Browse the repository at this point in the history
slurm adapter 监听地址支持可配
  • Loading branch information
283713406 authored Nov 5, 2024
2 parents 24f10ff + a103247 commit ef6b15a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ mysql:
clustername: cluster
databaseencode: latin1

# 服务端口设置
# 服务地址设置
service:
port: 8972
addr: 0.0.0.0:8972

# slurm 默认Qos设置
slurm:
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import (
func main() {
os.Setenv("SLURM_TIME_FORMAT", "standard") // 新加slurm环境变量
// 启动服务
portString := fmt.Sprintf(":%d", caller.ConfigValue.Service.Port)
lis, err := net.Listen("tcp", portString)
lis, err := net.Listen("tcp", caller.ConfigValue.Service.Addr)
if err != nil {
fmt.Printf("failed to listen: %v", err)
return
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type MySQLConfig struct {
}

type Service struct {
Port int `yaml:"port"`
Addr string `yaml:"addr"`
}

type Slurm struct {
Expand Down

0 comments on commit ef6b15a

Please sign in to comment.