@@ -211,6 +211,7 @@ public WorkspaceModel CurrentSpace
211211 /// <summary>
212212 /// Controls if the the ML data ingestion pipeline is beta from feature flag
213213 /// </summary>
214+ [ Obsolete ( "This flag is not needed anymore and will be removed in a future version of Dynamo. Use EnableDNADataIngestionPipeline instead" ) ]
214215 internal bool IsDNADataIngestionPipelineinBeta
215216 {
216217 get
@@ -219,6 +220,17 @@ internal bool IsDNADataIngestionPipelineinBeta
219220 }
220221 }
221222
223+ /// <summary>
224+ /// Controls if the the ML data ingestion pipeline is enabled or not.
225+ /// </summary>
226+ internal bool EnableDNADataIngestionPipeline
227+ {
228+ get
229+ {
230+ return DynamoModel . FeatureFlags ? . CheckFeatureFlag ( "EnableDNADataIngestionPipeline" , false ) ?? false ;
231+ }
232+ }
233+
222234 /// <summary>
223235 /// Controls if the cluster node autocomplete placement feature is enabled from feature flag
224236 /// </summary>
@@ -3332,26 +3344,31 @@ private void CloseHomeWorkspace(object parameter)
33323344 // Upon closing a workspace, validate if the workspace is valid to be sent to the ML datapipeline and then send it.
33333345 if ( ! DynamoModel . IsTestMode && ! HomeSpace . HasUnsavedChanges && ( currentWorkspaceViewModel ? . IsHomeSpace ?? true ) && HomeSpace . HasRunWithoutCrash )
33343346 {
3335- // Currently IsDNADataIngestionPipelineinBeta is set to true for debug builds and false for release builds. so we need to modify it here, when testing the pipeline in debug builds.
3336- if ( ! IsDNADataIngestionPipelineinBeta && Model . CurrentWorkspace . IsValidForFDX && currentWorkspaceViewModel . Checksum != string . Empty )
3347+ if ( preferencesViewModel . IsMLAutocompleteTOUApproved )
33373348 {
3338- if ( HasDifferentialCheckSum ( ) )
3349+ // Currently IsDNADataIngestionPipelineinBeta is set to true for debug builds and false for release builds. so we need to modify it here, when testing the pipeline in debug builds.
3350+ if ( EnableDNADataIngestionPipeline && Model . CurrentWorkspace . IsValidForFDX && currentWorkspaceViewModel . Checksum != string . Empty )
33393351 {
3340- Model . Logger . Log ( "This Workspace is being shared to train the Dynamo Machine Learning model." , LogLevel . File ) ;
3341- var workspacePath = model . CurrentWorkspace . FileName ;
3342-
3343- Task . Run ( ( ) =>
3352+ if ( HasDifferentialCheckSum ( ) )
33443353 {
3345- try
3346- {
3347- MLDataPipelineExtension . DynamoMLDataPipeline . SendWorkspaceLog ( workspacePath ) ;
3348- }
3349- catch ( Exception ex )
3354+ Model . Logger . Log ( "This Workspace is being shared to train the Dynamo Machine Learning model." , LogLevel . File ) ;
3355+ MLDataPipelineExtension . DynamoMLDataPipeline . isWorkspaceSharedWithML = true ;
3356+
3357+ var workspacePath = model . CurrentWorkspace . FileName ;
3358+
3359+ Task . Run ( ( ) =>
33503360 {
3351- Model . Logger . Log ( "Failed to share this workspace with ML pipeline." , LogLevel . File ) ;
3352- Model . Logger . Log ( ex . StackTrace , LogLevel . File ) ;
3353- }
3354- } ) ;
3361+ try
3362+ {
3363+ MLDataPipelineExtension . DynamoMLDataPipeline . SendWorkspaceLog ( workspacePath ) ;
3364+ }
3365+ catch ( Exception ex )
3366+ {
3367+ Model . Logger . Log ( "Failed to share this workspace with ML pipeline." , LogLevel . File ) ;
3368+ Model . Logger . Log ( ex . StackTrace , LogLevel . File ) ;
3369+ }
3370+ } ) ;
3371+ }
33553372 }
33563373 }
33573374 }
0 commit comments