Verbessere Fehlerbehandlung in Transport- und Produktionslogik: Optimiere die Bedingungen für den Transportstart und die Verarbeitung abgeschlossener Produktionen, um die Lesbarkeit zu erhöhen und Fehler effizienter zu handhaben.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m24s
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m24s
This commit is contained in:
@@ -79,11 +79,10 @@ impl FalukantFamilyWorker {
|
||||
self.base.set_current_step("FalukantFamilyWorker iteration");
|
||||
let now = Instant::now();
|
||||
|
||||
if !self.schema_ready {
|
||||
if let Ok(true) = self.check_schema() {
|
||||
if !self.schema_ready
|
||||
&& let Ok(true) = self.check_schema() {
|
||||
self.schema_ready = true;
|
||||
}
|
||||
}
|
||||
|
||||
if Self::should_run(self.last_certificate_recalc, now, CERTIFICATE_RECALC_INTERVAL) {
|
||||
if let Err(e) = super::falukant_certificate::run_daily(&self.base, &self.base.broker) {
|
||||
@@ -96,11 +95,10 @@ impl FalukantFamilyWorker {
|
||||
if let Err(e) = super::falukant_debtors::run_daily(&self.base, &self.base.broker) {
|
||||
eprintln!("[FalukantFamilyWorker] falukant_debtors::run_daily: {e}");
|
||||
}
|
||||
if self.schema_ready {
|
||||
if let Err(e) = self.process_daily() {
|
||||
if self.schema_ready
|
||||
&& let Err(e) = self.process_daily() {
|
||||
eprintln!("[FalukantFamilyWorker] process_daily: {e}");
|
||||
}
|
||||
}
|
||||
self.last_daily = Some(now);
|
||||
}
|
||||
|
||||
@@ -111,23 +109,20 @@ impl FalukantFamilyWorker {
|
||||
self.last_monthly = Some(now);
|
||||
}
|
||||
|
||||
if self.servants_schema_ready || self.lover_installment_schema_ready {
|
||||
if Self::should_run(self.last_game_month_slice, now, GAME_MONTH_SLICE_INTERVAL) {
|
||||
if self.servants_schema_ready {
|
||||
if let Err(e) =
|
||||
if (self.servants_schema_ready || self.lover_installment_schema_ready)
|
||||
&& Self::should_run(self.last_game_month_slice, now, GAME_MONTH_SLICE_INTERVAL) {
|
||||
if self.servants_schema_ready
|
||||
&& let Err(e) =
|
||||
super::falukant_servants::run_monthly(&self.base, &self.base.broker)
|
||||
{
|
||||
eprintln!("[FalukantFamilyWorker] falukant_servants::run_monthly: {e}");
|
||||
}
|
||||
}
|
||||
if self.lover_installment_schema_ready {
|
||||
if let Err(e) = self.process_lover_installments() {
|
||||
if self.lover_installment_schema_ready
|
||||
&& let Err(e) = self.process_lover_installments() {
|
||||
eprintln!("[FalukantFamilyWorker] process_lover_installments: {e}");
|
||||
}
|
||||
}
|
||||
self.last_game_month_slice = Some(now);
|
||||
}
|
||||
}
|
||||
|
||||
std::thread::sleep(Duration::from_secs(1));
|
||||
if !state.running_worker.load(Ordering::Relaxed) {
|
||||
@@ -650,7 +645,7 @@ impl FalukantFamilyWorker {
|
||||
}
|
||||
p = p.clamp(0.0, 25.0);
|
||||
if self.dist.sample(&mut self.rng) * 100.0 < p {
|
||||
let _ = self.base.broker.publish(format!(
|
||||
self.base.broker.publish(format!(
|
||||
r#"{{"event":"falukant_family_scandal_hint","relationship_id":{}}}"#,
|
||||
l.rel_id
|
||||
));
|
||||
@@ -852,13 +847,11 @@ impl FalukantFamilyWorker {
|
||||
let mut free_slots_by_char: HashMap<i32, i32> = HashMap::new();
|
||||
let mut seen_payer: HashSet<i32> = HashSet::new();
|
||||
for it in &items {
|
||||
if let Some(cid) = it.payer_cid {
|
||||
if seen_payer.insert(cid) {
|
||||
if let Ok(n) = super::political_benefits::sum_free_lover_slots(&mut conn, cid) {
|
||||
if let Some(cid) = it.payer_cid
|
||||
&& seen_payer.insert(cid)
|
||||
&& let Ok(n) = super::political_benefits::sum_free_lover_slots(&mut conn, cid) {
|
||||
free_slots_by_char.insert(cid, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut cur_group = -2i32;
|
||||
|
||||
Reference in New Issue
Block a user