@@ -622,20 +622,13 @@ impl NodeGroupsPlugin {
622622 for group in webhook_groups {
623623 if let Some ( plugins) = & self . webhook_plugins {
624624 for plugin in plugins. iter ( ) {
625- let group_clone = group. clone ( ) ;
626- let plugin_clone = plugin. clone ( ) ;
627- tokio:: spawn ( async move {
628- if let Err ( e) = plugin_clone
629- . send_group_created (
630- group_clone. id . to_string ( ) ,
631- group_clone. configuration_name . to_string ( ) ,
632- group_clone. nodes . iter ( ) . cloned ( ) . collect ( ) ,
633- )
634- . await
635- {
636- error ! ( "Failed to send group created webhook: {e}" ) ;
637- }
638- } ) ;
625+ if let Err ( e) = plugin. send_group_created (
626+ group. id . clone ( ) ,
627+ group. configuration_name . clone ( ) ,
628+ group. nodes . iter ( ) . cloned ( ) . collect ( ) ,
629+ ) {
630+ error ! ( "Failed to send group created webhook: {}" , e) ;
631+ }
639632 }
640633 }
641634 }
@@ -981,51 +974,36 @@ impl NodeGroupsPlugin {
981974 }
982975
983976 // Send webhook notifications
984- self . send_merge_webhooks ( groups_to_merge, & merged_group)
985- . await ;
977+ self . send_merge_webhooks ( groups_to_merge, & merged_group) ;
986978
987979 Ok ( Some ( ( merged_group, group_ids_to_dissolve) ) )
988980 }
989981
990982 /// Send webhook notifications for group merging
991- async fn send_merge_webhooks ( & self , dissolved_groups : & [ NodeGroup ] , merged_group : & NodeGroup ) {
983+ fn send_merge_webhooks ( & self , dissolved_groups : & [ NodeGroup ] , merged_group : & NodeGroup ) {
992984 if let Some ( plugins) = & self . webhook_plugins {
993985 // Send dissolved notifications
994986 for group in dissolved_groups {
995987 for plugin in plugins. iter ( ) {
996- let plugin_clone = plugin. clone ( ) ;
997- let group_clone = group. clone ( ) ;
998- tokio:: spawn ( async move {
999- if let Err ( e) = plugin_clone
1000- . send_group_destroyed (
1001- group_clone. id ,
1002- group_clone. configuration_name ,
1003- group_clone. nodes . iter ( ) . cloned ( ) . collect ( ) ,
1004- )
1005- . await
1006- {
1007- error ! ( "Failed to send group dissolved webhook: {e}" ) ;
1008- }
1009- } ) ;
988+ if let Err ( e) = plugin. send_group_destroyed (
989+ group. id . clone ( ) ,
990+ group. configuration_name . clone ( ) ,
991+ group. nodes . iter ( ) . cloned ( ) . collect ( ) ,
992+ ) {
993+ error ! ( "Failed to send group dissolved webhook: {}" , e) ;
994+ }
1010995 }
1011996 }
1012997
1013998 // Send created notification
1014999 for plugin in plugins. iter ( ) {
1015- let plugin_clone = plugin. clone ( ) ;
1016- let group_clone = merged_group. clone ( ) ;
1017- tokio:: spawn ( async move {
1018- if let Err ( e) = plugin_clone
1019- . send_group_created (
1020- group_clone. id ,
1021- group_clone. configuration_name ,
1022- group_clone. nodes . iter ( ) . cloned ( ) . collect ( ) ,
1023- )
1024- . await
1025- {
1026- error ! ( "Failed to send group created webhook: {e}" ) ;
1027- }
1028- } ) ;
1000+ if let Err ( e) = plugin. send_group_created (
1001+ merged_group. id . clone ( ) ,
1002+ merged_group. configuration_name . clone ( ) ,
1003+ merged_group. nodes . iter ( ) . cloned ( ) . collect ( ) ,
1004+ ) {
1005+ error ! ( "Failed to send group created webhook: {}" , e) ;
1006+ }
10291007 }
10301008 }
10311009 }
@@ -1098,20 +1076,13 @@ impl NodeGroupsPlugin {
10981076 ) ;
10991077 if let Some ( plugins) = & self . webhook_plugins {
11001078 for plugin in plugins. iter ( ) {
1101- let plugin_clone = plugin. clone ( ) ;
1102- let group_clone = group. clone ( ) ;
1103- tokio:: spawn ( async move {
1104- if let Err ( e) = plugin_clone
1105- . send_group_destroyed (
1106- group_clone. id . to_string ( ) ,
1107- group_clone. configuration_name . to_string ( ) ,
1108- group_clone. nodes . iter ( ) . cloned ( ) . collect ( ) ,
1109- )
1110- . await
1111- {
1112- error ! ( "Failed to send group dissolved webhook: {e}" ) ;
1113- }
1114- } ) ;
1079+ if let Err ( e) = plugin. send_group_destroyed (
1080+ group. id . clone ( ) ,
1081+ group. configuration_name . clone ( ) ,
1082+ group. nodes . iter ( ) . cloned ( ) . collect ( ) ,
1083+ ) {
1084+ error ! ( "Failed to send group dissolved webhook: {}" , e) ;
1085+ }
11151086 }
11161087 }
11171088 } else {
0 commit comments