Repository navigation
feat(jobs): gate the save workflow on the platforms change flag - #1494
Merged
Merged
Conversation
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.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fetchLatestEpisodes now returns SmartResponse (episodes + hasChanged) like SmartHttpClient does, and the save workflow runs only when at least one platform reports a change.