Skip to content

feat(jobs): gate the save workflow on the platforms change flag - #1494

Merged
Ziedelth merged 5 commits into
refactor/multi-modulefrom
feat/ingestion-change-check
Oct 22, 2026
Merged

Ziedelth merged 5 commits into
refactor/multi-modulefrom
feat/ingestion-change-check

Conversation

@Ziedelth

@Ziedelth Ziedelth commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

fetchLatestEpisodes now returns SmartResponse (episodes + hasChanged) like SmartHttpClient does, and the save workflow runs only when at least one platform reports a change.

The platforms return every episode on each fetch, so a periodic job would run the
save/modify workflow on an unchanged harvest every tick. AnimeIngestionService.saveAll
now takes the harvested episodes and derives one content key per distinct episode
(plain constructor fields, the carried anime key derived once per distinct instance).
The workflow is skipped before any database access when the harvest is empty or
unchanged since the last successful save, and the keys are stored only after the
workflow completed so a failed run is retried on the next tick.
fetchLatestEpisodes returns SmartResponse (episodes + hasChanged) like SmartHttpClient,
and saveAll skips before any database access when no platform reports a change.
@Ziedelth Ziedelth changed the title feat(jobs): gate the save workflow on harvest content change feat(jobs): gate the save workflow on the platforms change flag Oct 20, 2026
One saveAll per test with the prior state seeded in Given, one merged guard with
a lazily computed grouping so a quiet tick stays free, and the hasChanged flag
inlined in the platform.
…rules

The quiet-harvest guard is now the first statement of saveAll: it reads the
harvest itself (`harvest.all { it.data.isEmpty() }` instead of the grouped
map), so a harvest that brings nothing to persist is skipped before anything
is grouped, and nothing else runs.

A condition of up to three operands is collapsed on one line wherever it was
spread over several (ingestion gate, localization save, ADN movie detection,
ADN change flag, ADN video validity). The uncensored-title check of AdnVideo
moves into a named function, its two operands no longer fitting 110 characters.

The guidelines record the rules: a guard clause opens the function, a condition
holds at most three operands on one line - beyond, one per line in a function
named after the check - and the 110-character limit counts code only, from the
first non-whitespace character.

tools/check_line_length.py reports every code line over the limit and exits
non-zero; the five lines it found are split.

Verified with ./gradlew :jobs:test :database:test :admin:test (97 tests passed)
and tools/check_line_length.py (0 violation).
…ding

A full run of qodana-jvm-community over the branch reported 25 problems; the
module now scans clean, with no sanity failure and no problem left.

- Drop the five unused imports of LoginAdminUserUseCaseImpl.
- Replace the redundant `let` of SetEnumColumnTransformer.wrap with an explicit
  if/else on the blank value.
- Name the performance benchmark after its @DisplayName: Qodana rejects a
  backticked function name holding anything but letters and digits.
- Delete what nothing consumes: UserEntity.USER_TABLE_ID, and the suspend
  variants of the performance harness (measureAndAssertSuspend and
  PerfProfiler.measureSuspend), superseded by their synchronous counterparts.
- Suppress UnusedSymbol where the runtime resolves the symbol: the admin
  controller (bound by Koin, routed from its annotations) and the Quartz job
  (instantiated by the scheduler), the idiom the project already uses for
  KoinJobFactory.
- Restore qodana.yaml, lost with the old src/ tree: it pins the linter and the
  recommended profile, and excludes UnusedSymbol from `:models`, whose
  declarations are consumed by the applications and the serialized payloads
  rather than inside the module.

Verified with ./gradlew :jobs:test :jobs:integrationTest
:jobs:compilePerfTestKotlin :database:test :admin:test (100 tests passed) and
tools/check_line_length.py (0 violation).
@Ziedelth
Ziedelth merged commit 4ebb3ba into refactor/multi-module Oct 22, 2026
1 of 3 checks passed
@Ziedelth
Ziedelth deleted the feat/ingestion-change-check branch October 22, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant