Skip to content

Commit 5118172

Browse files
committed
Removed validation for approval, trigger and proposal in total data cap reached scenario
1 parent 2a1e56a commit 5118172

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

fplus-lib/src/core/application/lifecycle.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ impl LifeCycle {
6464
res
6565
}
6666

67+
pub fn get_active_status(&self) -> bool {
68+
let res = self.is_active.clone();
69+
res
70+
}
71+
6772
pub fn start_refill_request(&self, request_id: String) -> Self {
6873
LifeCycle {
6974
state: AppState::ReadyToSign,

fplus-lib/src/core/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,10 @@ impl LDNApplication {
804804
);
805805

806806
if let Ok(application_file) = LDNApplication::single_active(pr_number).await {
807+
if application_file.lifecycle.get_active_status() == false {
808+
log::info!("No trigger to validate. Application lifecycle is inactive so the Total DC was reached.");
809+
return Ok(true);
810+
}
807811
let validated_by = application_file.lifecycle.validated_by.clone();
808812
let validated_at = application_file.lifecycle.validated_at.clone();
809813
let app_state = application_file.lifecycle.get_state();
@@ -947,7 +951,12 @@ impl LDNApplication {
947951
log::info!("Validating approval for PR number {}", pr_number);
948952
match LDNApplication::single_active(pr_number).await {
949953
Ok(application_file) => {
954+
if application_file.lifecycle.get_active_status() == false {
955+
log::info!("No approval to validate. Application lifecycle is inactive so the Total DC was reached.");
956+
return Ok(true);
957+
}
950958
let app_state: AppState = application_file.lifecycle.get_state();
959+
951960
log::info!("- App state is {:?}", app_state.as_str());
952961
if app_state < AppState::Granted {
953962
log::warn!("- State is less than Granted");
@@ -1001,6 +1010,10 @@ impl LDNApplication {
10011010
log::info!("- Validating proposal for PR number {}", pr_number);
10021011
match LDNApplication::single_active(pr_number).await {
10031012
Ok(application_file) => {
1013+
if application_file.lifecycle.get_active_status() == false {
1014+
log::info!("No proposal to validate. Application lifecycle is inactive so the Total DC was reached.");
1015+
return Ok(true);
1016+
}
10041017
let app_state: AppState = application_file.lifecycle.get_state();
10051018
log::info!("- App state is {:?}", app_state.as_str());
10061019
if app_state < AppState::StartSignDatacap {

0 commit comments

Comments
 (0)