fix(tours): Tagesumschlag nach Ortszeit statt UTC
'Heute' wurde per Utc::now().date_naive() bestimmt. Bei CEST (UTC+2) wechselte der Tag dadurch erst um 02:00 Ortszeit — der Fahrer sah nach Mitternacht noch die Touren von gestern. Umgestellt auf Local::now() in list_my_tours_today sowie den Import-/Resync-Defaults und dem Scheduler-Catch-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -559,7 +559,7 @@ pub(crate) async fn run_app(
|
||||
let job = Job::new_async(cfg.import.cron.as_str(), move |_uuid, _lock| {
|
||||
let import = import.clone();
|
||||
Box::pin(async move {
|
||||
let date = (chrono::Utc::now() + chrono::Duration::days(offset)).date_naive();
|
||||
let date = (chrono::Local::now() + chrono::Duration::days(offset)).date_naive();
|
||||
match import.execute_with(date, SyncTrigger::Scheduler).await {
|
||||
Ok(summary) => tracing::info!(
|
||||
date = %summary.date,
|
||||
@ -592,7 +592,7 @@ pub(crate) async fn run_app(
|
||||
let sync_runs = sync_run_repository.clone();
|
||||
let offset = cfg.import.date_offset_days;
|
||||
tokio::spawn(async move {
|
||||
let date = (chrono::Utc::now() + chrono::Duration::days(offset)).date_naive();
|
||||
let date = (chrono::Local::now() + chrono::Duration::days(offset)).date_naive();
|
||||
match sync_runs.has_successful_run_for(date).await {
|
||||
Ok(true) => tracing::info!(
|
||||
%date,
|
||||
|
||||
@ -82,7 +82,7 @@ pub async fn import_erp(
|
||||
"ungültiges Datum '{s}' (erwartet YYYY-MM-DD): {e}"
|
||||
)))
|
||||
})?,
|
||||
None => chrono::Utc::now().date_naive(),
|
||||
None => chrono::Local::now().date_naive(),
|
||||
};
|
||||
tracing::info!(%date, "admin.import_erp");
|
||||
let summary = state.import_erp_tours.execute(date).await?;
|
||||
|
||||
@ -50,7 +50,7 @@ pub async fn dev_resync(
|
||||
"ungültiges Datum '{s}' (erwartet YYYY-MM-DD): {e}"
|
||||
)))
|
||||
})?,
|
||||
None => chrono::Utc::now().date_naive(),
|
||||
None => chrono::Local::now().date_naive(),
|
||||
};
|
||||
tracing::warn!(%date, "dev.resync: Postgres wird überschrieben + neu importiert");
|
||||
let summary = state.dev_resync_tours.execute(date).await?;
|
||||
|
||||
Reference in New Issue
Block a user