This commit is contained in:
parent
69e46f577a
commit
1d1a225be6
@ -69,6 +69,9 @@ func (p *Processor) waitForApp() error {
|
|||||||
statsProcessor := StatsProcessor{
|
statsProcessor := StatsProcessor{
|
||||||
DB: p.DB,
|
DB: p.DB,
|
||||||
DockerSock: p.DockerSock,
|
DockerSock: p.DockerSock,
|
||||||
|
BindIPHTTP: p.BindIPHTTP,
|
||||||
|
BindIPSSH: p.BindIPSSH,
|
||||||
|
AppsPath: p.AppsPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < loops; i++ {
|
for i := 0; i < loops; i++ {
|
||||||
@ -104,6 +107,9 @@ func (p *Processor) List() (apps.Apps, error) {
|
|||||||
statsProcessor := StatsProcessor{
|
statsProcessor := StatsProcessor{
|
||||||
DB: p.DB,
|
DB: p.DB,
|
||||||
DockerSock: p.DockerSock,
|
DockerSock: p.DockerSock,
|
||||||
|
BindIPHTTP: p.BindIPHTTP,
|
||||||
|
BindIPSSH: p.BindIPSSH,
|
||||||
|
AppsPath: p.AppsPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := statsProcessor.GatherStates()
|
err := statsProcessor.GatherStates()
|
||||||
@ -128,6 +134,9 @@ func (p *Processor) Get() (apps.App, error) {
|
|||||||
statsProcessor := StatsProcessor{
|
statsProcessor := StatsProcessor{
|
||||||
DB: p.DB,
|
DB: p.DB,
|
||||||
DockerSock: p.DockerSock,
|
DockerSock: p.DockerSock,
|
||||||
|
BindIPHTTP: p.BindIPHTTP,
|
||||||
|
BindIPSSH: p.BindIPSSH,
|
||||||
|
AppsPath: p.AppsPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := statsProcessor.UpdateState(p.AppName)
|
err := statsProcessor.UpdateState(p.AppName)
|
||||||
|
@ -13,6 +13,9 @@ import (
|
|||||||
type StatsProcessor struct {
|
type StatsProcessor struct {
|
||||||
DB *gorm.DB
|
DB *gorm.DB
|
||||||
DockerSock string
|
DockerSock string
|
||||||
|
BindIPHTTP string
|
||||||
|
BindIPSSH string
|
||||||
|
AppsPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns instance of getAppProcessor
|
// returns instance of getAppProcessor
|
||||||
@ -36,6 +39,9 @@ func (s *StatsProcessor) UpdateUsage(name string) error {
|
|||||||
container := docker.Container{
|
container := docker.Container{
|
||||||
App: &app,
|
App: &app,
|
||||||
DockerSock: s.DockerSock,
|
DockerSock: s.DockerSock,
|
||||||
|
BindIPHTTP: s.BindIPHTTP,
|
||||||
|
BindIPSSH: s.BindIPSSH,
|
||||||
|
AppsPath: s.AppsPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
state, err := container.GetState()
|
state, err := container.GetState()
|
||||||
@ -67,6 +73,9 @@ func (s *StatsProcessor) UpdateState(name string) error {
|
|||||||
container := docker.Container{
|
container := docker.Container{
|
||||||
App: &app,
|
App: &app,
|
||||||
DockerSock: s.DockerSock,
|
DockerSock: s.DockerSock,
|
||||||
|
BindIPHTTP: s.BindIPHTTP,
|
||||||
|
BindIPSSH: s.BindIPSSH,
|
||||||
|
AppsPath: s.AppsPath,
|
||||||
}
|
}
|
||||||
state, err := container.Status()
|
state, err := container.Status()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
3
main.go
3
main.go
@ -76,6 +76,9 @@ func main() {
|
|||||||
statsProcessor := glue.StatsProcessor{
|
statsProcessor := glue.StatsProcessor{
|
||||||
DB: common.GetDBConnection(),
|
DB: common.GetDBConnection(),
|
||||||
DockerSock: config.DockerSocket,
|
DockerSock: config.DockerSocket,
|
||||||
|
BindIPHTTP: config.AppsBindIPHTTP,
|
||||||
|
BindIPSSH: config.AppsBindIPSSH,
|
||||||
|
AppsPath: config.AppsPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user