Conversation
… NULL check - Switch the progress bar to busy mode while distances are recalculated after a GSAK import (it sat at 100% with no feedback). - When several GSAK databases go into the same target, only the last job recalculates; earlier jobs clear the stored dist_calc_* values, so the existing up-to-date check still catches a skipped/failed last job. - Migration 25: partial index ix_caches_distance_missing (distance IS NULL), so distances_up_to_date()'s NULL check no longer scans the whole table (~1 s -> <1 ms at 180k caches). Follow-up to OpenSAK-Org#956.
…provement/gsak-import-distance-followups
Member
|
#963 is merged now, so this one has conflicts in db/database.py and gui/dialogs/gsak_import_dialog.py. They look small — the comment in distances_up_to_date() and the worker's run(). Could you rebase onto beta? Worth double-checking after the rebase that _invalidate_distances() and the busy-progress emit still sit correctly in the new session_for()-based run(). |
…stance-followups - distances_up_to_date(): use _session_on(db_path), keep index comment - GsakImportWorker.run(): busy progress and _invalidate_distances() on target_path in the session_for()-based run() - test: stub session_for instead of the removed init_db switch
Contributor
Author
|
@AgreeDK merged and aligned to newest Beta. PR in checks |
Member
|
@nagisml |
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.
Follow-up to #956: the three non-blocking points from its review.
Changes
GsakImportWorkeremitsprogress(0, 0)before recalculating distances, so the bar switches to busy mode instead of sitting at 100%.update_distancesflag on the worker is set only on the last job for each target. Earlier jobs clear the target'sdist_calc_*values instead. If the last job is skipped, fails or is cancelled,distances_up_to_date()reports the distances as stale and the existing check after the import or on a database switch recalculates them.SCHEMA_VERSION24 → 25): a partial indexix_caches_distance_missing ON caches (id) WHERE distance IS NULL.Measurements (real database, 183k caches)
Note: the schema bump triggers the usual one-time pre-migration backup of each database.
Tests
update_distances=Falseit clears the stored values instead of recalculating.[False, True, True], no NULL distances left.dist_calc_*values read back as stale.Full suite: 4758 passed, 105 skipped; mypy clean.
maybe a rebase is needed before merge.