Project

General

Profile

Actions

Task #6125

open

Task #6116: EPIC: Speed up the stats updater daemon (scripts/workflow/update_stats.sh)

Run one round in a single JVM instead of 10 separate launches

Added by Redmine Admin about 9 hours ago. Updated about 9 hours ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Start date:
08/26/2026
Due date:
% Done:

90%

Estimated time:

Description

Problem

scripts/workflow/update_stats.sh shells out to 10 wrapper scripts per round, each of which is a fresh java -jar launch. Every launch pays for JVM start, Micronaut context creation, Flyway migration check and Hikari pool setup, and throws away all JIT warm-up from the previous step. The wrappers themselves also re-read VERSION via $(cat VERSION) on each call.

Proposed change

Add a run-stats-round command to Application.kt that executes the same sequence in-process:

sync-dialogs-with-usersgenerate-user-partner-connectionsdownload-companies-from-iikodownload-employees-from-iikodistribute-employees-companies-partnersobsolete-companiesdownload-trading-point-inspectionsiiko-partner-metrics-synciiko-stats-data-synciiko-users-metrics-sync

  • A failing step logs and the round continues to the next step (matching today's behaviour, where each script exits independently).
  • Combined with the session-reuse task, one IIKO session then covers the whole round rather than being re-established ten times.
  • The daemon loop shrinks to a single call plus its notification.

Keep the individual commands working standalone — they are used for manual repair runs.

Acceptance

  • run-stats-round performs the full sequence in one process.
  • Individual commands still run standalone.
  • update_stats.sh updated to call it.
Actions

Also available in: Atom PDF