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
35 print (" turning off chromedriver on port " .. private .port )
46
57 private .fetch ({
68 http_version = " 1.1" ,
79 url = string.format (" http://127.0.0.1:%d/shutdown" , private .port ),
810 })
9-
11+ private .closed = true
12+ end
13+
14+
15+ Server .__gc = function (public ,private )
16+ public .close ()
1017end
1118
1219Server .newSession = function (public ,private , props )
@@ -37,6 +44,7 @@ WebDriver.newLocalServer = function(props)
3744 selfobj .private_props_extends (props )
3845 selfobj .private .url = " http://127.0.0.1:" .. selfobj .private .port
3946 selfobj .set_meta_method (" __gc" , Server .__gc )
47+ selfobj .set_meta_method (" close" , Server .close )
4048 selfobj .set_public_method (" newSession" , Server .newSession )
4149
4250
You can’t perform that action at this time.
0 commit comments