@@ -118,6 +118,10 @@ async fn test_connection(
118
118
. await ;
119
119
}
120
120
121
+ if let Some ( delay) = connection_config. test_delay_in_millis {
122
+ tokio:: time:: sleep ( Duration :: from_millis ( delay) ) . await
123
+ }
124
+
121
125
let res = state
122
126
. extractor_caller
123
127
. execute_model_definition (
@@ -138,30 +142,8 @@ async fn test_connection(
138
142
}
139
143
140
144
impl PublicExt < Connection > for CreateConnectionPayload {
141
- fn public ( input : Connection ) -> Value {
142
- SanitizedConnection {
143
- id : input. id ,
144
- platform_version : input. platform_version ,
145
- connection_definition_id : input. connection_definition_id ,
146
- r#type : input. r#type ,
147
- key : input. key ,
148
- group : input. group ,
149
- name : input. name ,
150
- environment : input. environment ,
151
- platform : input. platform ,
152
- secrets_service_id : input. secrets_service_id ,
153
- event_access_id : input. event_access_id ,
154
- identity : input. identity ,
155
- identity_type : input. identity_type ,
156
- settings : input. settings ,
157
- throughput : input. throughput ,
158
- ownership : input. ownership ,
159
- error : input. error ,
160
- has_error : input. has_error ,
161
- oauth : input. oauth ,
162
- record_metadata : input. record_metadata ,
163
- }
164
- . to_value ( )
145
+ fn public ( conn : Connection ) -> Value {
146
+ Into :: < SanitizedConnection > :: into ( conn) . to_value ( )
165
147
}
166
148
}
167
149
@@ -303,7 +285,7 @@ pub async fn create_connection(
303
285
error ! ( "Error creating secret for connection: {:?}" , e) ;
304
286
} ) ?;
305
287
306
- let connection = Connection {
288
+ let conn = Connection {
307
289
id : connection_id,
308
290
platform_version : connection_config. clone ( ) . platform_version ,
309
291
connection_definition_id : payload. connection_definition_id ,
@@ -333,34 +315,13 @@ pub async fn create_connection(
333
315
state
334
316
. app_stores
335
317
. connection
336
- . create_one ( & connection )
318
+ . create_one ( & conn )
337
319
. await
338
320
. inspect_err ( |e| {
339
321
error ! ( "Error creating connection: {:?}" , e) ;
340
322
} ) ?;
341
323
342
- Ok ( Json ( SanitizedConnection {
343
- id : connection. id ,
344
- platform_version : connection. platform_version ,
345
- connection_definition_id : connection. connection_definition_id ,
346
- r#type : connection. r#type ,
347
- key : connection. key ,
348
- group : connection. group ,
349
- name : connection. name ,
350
- environment : connection. environment ,
351
- platform : connection. platform ,
352
- secrets_service_id : connection. secrets_service_id ,
353
- event_access_id : connection. event_access_id ,
354
- identity : connection. identity ,
355
- identity_type : connection. identity_type ,
356
- settings : connection. settings ,
357
- throughput : connection. throughput ,
358
- ownership : connection. ownership ,
359
- has_error : connection. has_error ,
360
- error : connection. error ,
361
- oauth : connection. oauth ,
362
- record_metadata : connection. record_metadata ,
363
- } ) )
324
+ Ok ( Json ( conn. into ( ) ) )
364
325
}
365
326
366
327
async fn generate_k8s_specs_and_secret (
0 commit comments