@@ -11,12 +11,12 @@ use sqlx::{PgConnection, PgPool, error::Error as SqlxError};
1111use thiserror:: Error ;
1212use tokio:: sync:: broadcast:: Sender ;
1313
14- #[ cfg( not( test) ) ]
15- use super :: is_enterprise_enabled;
1614use super :: {
1715 db:: models:: openid_provider:: { DirectorySyncTarget , OpenIdProvider } ,
1816 ldap:: utils:: ldap_update_users_state,
1917} ;
18+ #[ cfg( not( test) ) ]
19+ use crate :: enterprise:: is_business_license_active;
2020use crate :: {
2121 db:: { GatewayEvent , Group , User } ,
2222 enterprise:: {
@@ -383,7 +383,7 @@ pub(crate) async fn test_directory_sync_connection(
383383 pool : & PgPool ,
384384) -> Result < ( ) , DirectorySyncError > {
385385 #[ cfg( not( test) ) ]
386- if !is_enterprise_enabled ( ) {
386+ if !is_business_license_active ( ) {
387387 debug ! ( "Enterprise is not enabled, skipping testing directory sync connection" ) ;
388388 return Ok ( ( ) ) ;
389389 }
@@ -408,7 +408,7 @@ pub(crate) async fn sync_user_groups_if_configured(
408408 wg_tx : & Sender < GatewayEvent > ,
409409) -> Result < ( ) , DirectorySyncError > {
410410 #[ cfg( not( test) ) ]
411- if !is_enterprise_enabled ( ) {
411+ if !is_business_license_active ( ) {
412412 debug ! ( "Enterprise is not enabled, skipping syncing user groups" ) ;
413413 return Ok ( ( ) ) ;
414414 }
@@ -966,7 +966,7 @@ pub(crate) async fn do_directory_sync(
966966 wireguard_tx : & Sender < GatewayEvent > ,
967967) -> Result < ( ) , DirectorySyncError > {
968968 #[ cfg( not( test) ) ]
969- if !is_enterprise_enabled ( ) {
969+ if !is_business_license_active ( ) {
970970 debug ! ( "Enterprise is not enabled, skipping performing directory sync" ) ;
971971 return Ok ( ( ) ) ;
972972 }
0 commit comments