@@ -188,8 +188,10 @@ public Optional<ActiveSession> apply(CreateSessionRequest sessionRequest) {
188
188
span .setStatus (Status .CANCELLED );
189
189
190
190
EXCEPTION .accept (attributeMap , e );
191
- attributeMap .put (AttributeKey .EXCEPTION_MESSAGE .getKey (),
192
- EventAttribute .setValue ("Unable to create session. Stopping and container: " + e .getMessage ()));
191
+ attributeMap .put (
192
+ AttributeKey .EXCEPTION_MESSAGE .getKey (),
193
+ EventAttribute
194
+ .setValue ("Unable to create session. Stopping and container: " + e .getMessage ()));
193
195
span .addEvent (AttributeKey .EXCEPTION_EVENT .getKey (), attributeMap );
194
196
195
197
container .stop (Duration .ofMinutes (1 ));
@@ -199,16 +201,16 @@ public Optional<ActiveSession> apply(CreateSessionRequest sessionRequest) {
199
201
200
202
SessionId id = new SessionId (response .getSessionId ());
201
203
Capabilities capabilities = new ImmutableCapabilities ((Map <?, ?>) response .getValue ());
204
+ Optional <Path > sessionAssetsPath = createSessionAssetsPath (assetsPath , id );
205
+ sessionAssetsPath .ifPresent (path -> saveSessionCapabilities (capabilities , path ));
202
206
Container videoContainer = null ;
203
207
if (isVideoRecordingAvailable && recordVideoForSession (capabilities )) {
204
208
Map <String , String > envVars = getVideoContainerEnvVars (
205
209
capabilities ,
206
210
containerInfo .getIp ());
207
- Optional <Path > sessionAssetsPath = createSessionAssetsPath (assetsPath , id );
208
211
if (sessionAssetsPath .isPresent ()) {
209
212
Map <String , String > volumeBinds =
210
213
Collections .singletonMap (sessionAssetsPath .get ().toString (), "/videos" );
211
- saveSessionCapabilities (capabilities , sessionAssetsPath .get ());
212
214
videoContainer = docker .create (image (videoImage ).env (envVars ).bind (volumeBinds ));
213
215
videoContainer .start ();
214
216
LOG .info (String .format ("Video container started (id: %s)" , videoContainer .getId ()));
0 commit comments