@@ -21,7 +21,7 @@ use crate::{
21
21
} } ,
22
22
parsers:: ParsedIssue ,
23
23
} ;
24
- use fplus_database:: database:: { self , allocators:: get_allocator} ;
24
+ use fplus_database:: database:: { self , allocators:: { get_allocator, update_allocator_threshold } } ;
25
25
use fplus_database:: models:: applications:: Model as ApplicationModel ;
26
26
27
27
use self :: application:: file:: {
@@ -677,7 +677,10 @@ impl LDNApplication {
677
677
// If blockchain threshold is available and different from DB, update DB (placeholder for update logic)
678
678
if let Some ( blockchain_threshold) = blockchain_threshold {
679
679
if blockchain_threshold != db_threshold {
680
- // TODO: Update the database with the new threshold from the blockchain
680
+ match update_allocator_threshold ( & owner, & repo, blockchain_threshold as i32 ) . await {
681
+ Ok ( _) => log:: info!( "Database updated with new multisig threshold" ) ,
682
+ Err ( e) => log:: error!( "Failed to update database: {}" , e) ,
683
+ } ;
681
684
}
682
685
}
683
686
// Use the blockchain threshold if available; otherwise, fall back to the database value
@@ -788,7 +791,10 @@ impl LDNApplication {
788
791
// If blockchain threshold is available and different from DB, update DB (placeholder for update logic)
789
792
if let Some ( blockchain_threshold) = blockchain_threshold {
790
793
if blockchain_threshold != db_threshold {
791
- // TODO: Update the database with the new threshold from the blockchain
794
+ match update_allocator_threshold ( & owner, & repo, blockchain_threshold as i32 ) . await {
795
+ Ok ( _) => log:: info!( "Database updated with new multisig threshold" ) ,
796
+ Err ( e) => log:: error!( "Failed to update database: {}" , e) ,
797
+ } ;
792
798
}
793
799
}
794
800
0 commit comments