28
28
_EC2_STARTUP_MAX_WAIT_TIME + _S4L_DOCKER_PULLING_MAX_TIME + _S4L_MAX_STARTUP_TIME
29
29
)
30
30
_S4L_STARTUP_SCREEN_MAX_TIME : Final [int ] = 45 * SECOND
31
-
31
+ _S4L_COPY_WORKSPACE_TIME : Final [ int ] = 60 * SECOND
32
32
33
33
@dataclass (kw_only = True )
34
34
class S4LWaitForWebsocket :
@@ -84,7 +84,7 @@ def __call__(self, message: str) -> bool:
84
84
return False
85
85
86
86
87
- def launch_S4L (page : Page , node_id , log_in_and_out : WebSocket , autoscaled : bool ) -> Dict [str , Union [WebSocket , FrameLocator ]]:
87
+ def launch_S4L (page : Page , node_id , log_in_and_out : WebSocket , autoscaled : bool , copy_workspace : bool = False ) -> Dict [str , Union [WebSocket , FrameLocator ]]:
88
88
with log_context (logging .INFO , "launch S4L" ) as ctx :
89
89
predicate = S4LWaitForWebsocket (logger = ctx .logger )
90
90
with page .expect_websocket (
@@ -95,6 +95,11 @@ def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool)
95
95
if autoscaled
96
96
else _S4L_MAX_STARTUP_TIME
97
97
)
98
+ + (
99
+ _S4L_COPY_WORKSPACE_TIME
100
+ if copy_workspace
101
+ else 0
102
+ )
98
103
+ 10 * SECOND ,
99
104
) as ws_info :
100
105
s4l_iframe = wait_for_service_running (
@@ -105,6 +110,11 @@ def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool)
105
110
_S4L_AUTOSCALED_MAX_STARTUP_TIME
106
111
if autoscaled
107
112
else _S4L_MAX_STARTUP_TIME
113
+ )
114
+ + (
115
+ _S4L_COPY_WORKSPACE_TIME
116
+ if copy_workspace
117
+ else 0
108
118
),
109
119
press_start_button = False ,
110
120
)
0 commit comments