Enhance production certificate logic and event handling: Updated the daily recalculation process in FalukantFamilyWorker to decouple it from family migration, ensuring consistent execution. Introduced a new mechanism to reset certificates upon succession without heirs, improving user experience. Refined SQL queries for better data retrieval and event publishing, including distinct character selection logic. Enhanced documentation for clarity on the updated processes and their implications.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 2m55s
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 2m55s
This commit is contained in:
@@ -75,15 +75,20 @@ impl FalukantFamilyWorker {
|
||||
if !self.schema_ready {
|
||||
if let Ok(true) = self.check_schema() {
|
||||
self.schema_ready = true;
|
||||
} else {
|
||||
std::thread::sleep(Duration::from_secs(1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if Self::should_run(self.last_daily, now, DAILY_INTERVAL) {
|
||||
if let Err(e) = self.process_daily() {
|
||||
eprintln!("[FalukantFamilyWorker] process_daily: {e}");
|
||||
if let Err(e) = super::falukant_debtors::run_daily(&self.base, &self.base.broker) {
|
||||
eprintln!("[FalukantFamilyWorker] falukant_debtors::run_daily: {e}");
|
||||
}
|
||||
if let Err(e) = super::falukant_certificate::run_daily(&self.base, &self.base.broker) {
|
||||
eprintln!("[FalukantFamilyWorker] falukant_certificate::run_daily: {e}");
|
||||
}
|
||||
if self.schema_ready {
|
||||
if let Err(e) = self.process_daily() {
|
||||
eprintln!("[FalukantFamilyWorker] process_daily: {e}");
|
||||
}
|
||||
}
|
||||
self.last_daily = Some(now);
|
||||
}
|
||||
@@ -155,12 +160,6 @@ impl FalukantFamilyWorker {
|
||||
if self.servants_schema_ready {
|
||||
super::falukant_servants::run_daily(&self.base, &self.base.broker)?;
|
||||
}
|
||||
if let Err(e) = super::falukant_debtors::run_daily(&self.base, &self.base.broker) {
|
||||
eprintln!("[FalukantFamilyWorker] falukant_debtors::run_daily: {e}");
|
||||
}
|
||||
if let Err(e) = super::falukant_certificate::run_daily(&self.base, &self.base.broker) {
|
||||
eprintln!("[FalukantFamilyWorker] falukant_certificate::run_daily: {e}");
|
||||
}
|
||||
|
||||
let mut conn = self
|
||||
.base
|
||||
|
||||
Reference in New Issue
Block a user