File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
-
2
- Server .__gc = function (public ,private )
1
+ Server .close = function (public ,private )
2
+ if private .closed then
3
+ return
4
+ end
3
5
print (" turning off chromedriver on port " .. private .port )
4
6
5
7
private .fetch ({
6
8
http_version = " 1.1" ,
7
9
url = string.format (" http://127.0.0.1:%d/shutdown" , private .port ),
8
10
})
9
-
11
+ private .closed = true
12
+ end
13
+
14
+
15
+ Server .__gc = function (public ,private )
16
+ public .close ()
10
17
end
11
18
12
19
Server .newSession = function (public ,private , props )
@@ -37,6 +44,7 @@ WebDriver.newLocalServer = function(props)
37
44
selfobj .private_props_extends (props )
38
45
selfobj .private .url = " http://127.0.0.1:" .. selfobj .private .port
39
46
selfobj .set_meta_method (" __gc" , Server .__gc )
47
+ selfobj .set_meta_method (" close" , Server .close )
40
48
selfobj .set_public_method (" newSession" , Server .newSession )
41
49
42
50
You can’t perform that action at this time.
0 commit comments