@@ -3,7 +3,13 @@ package main
3
3
import (
4
4
"context"
5
5
"fmt"
6
+ "net/http"
7
+ "os"
8
+ "os/signal"
9
+ "time"
10
+
6
11
log "github.com/sirupsen/logrus"
12
+
7
13
"github.com/qa-dev/jsonwire-grid/config"
8
14
"github.com/qa-dev/jsonwire-grid/handlers"
9
15
"github.com/qa-dev/jsonwire-grid/logger"
@@ -12,10 +18,6 @@ import (
12
18
"github.com/qa-dev/jsonwire-grid/pool/capabilities"
13
19
poolMetrics "github.com/qa-dev/jsonwire-grid/pool/metrics"
14
20
"github.com/qa-dev/jsonwire-grid/utils/metrics"
15
- "net/http"
16
- "os"
17
- "os/signal"
18
- "time"
19
21
)
20
22
21
23
func main () {
@@ -75,8 +77,6 @@ func main() {
75
77
poolInstance .SetBusyNodeDuration (busyNodeDuration )
76
78
poolInstance .SetReservedNodeDuration (reservedNodeDuration )
77
79
78
-
79
-
80
80
go func () {
81
81
for {
82
82
poolInstance .FixNodeStatuses ()
@@ -93,8 +93,6 @@ func main() {
93
93
}
94
94
}()
95
95
96
-
97
-
98
96
if cfg .Statsd != nil {
99
97
statsdClient , err := metrics .NewStatsd (
100
98
cfg .Statsd .Host ,
@@ -110,10 +108,11 @@ func main() {
110
108
}
111
109
middlewareWrap .Add (middleware .NewStatsd (log .StandardLogger (), statsdClient , true ).RegisterMetrics )
112
110
}
113
-
111
+
114
112
http .Handle ("/wd/hub/session" , middlewareWrap .Do (& handlers.CreateSession {Pool : poolInstance , ClientFactory : clientFactory })) //selenium
115
113
http .Handle ("/session" , middlewareWrap .Do (& handlers.CreateSession {Pool : poolInstance , ClientFactory : clientFactory })) //wda
116
114
http .Handle ("/grid/register" , middlewareWrap .Do (& handlers.RegisterNode {Pool : poolInstance }))
115
+ http .Handle ("/grid/status" , middlewareWrap .Do (& handlers.GridStatus {Pool : poolInstance , Config : * cfg }))
117
116
http .Handle ("/grid/api/proxy" , & handlers.APIProxy {Pool : poolInstance })
118
117
http .HandleFunc ("/_info" , heartbeat )
119
118
http .Handle ("/" , middlewareWrap .Do (& handlers.UseSession {Pool : poolInstance , Cache : cache }))
0 commit comments