Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV-1440 - write journal when indexing full file #62

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

aelkiss
Copy link
Member

@aelkiss aelkiss commented Dec 11, 2024

We were checking for a full journal file but not writing one when we did the full index, leading to a situation where regardless of journal file presence the "continue" command would do a full reindex every day.

This refactors the all command some, and tests that we are writing both the full and update journal files.

@aelkiss aelkiss requested a review from moseshll December 11, 2024 20:28
# "since" command for a month starts on the last day of last month
# because there will generally be both an "upd" and a "full" file.
call_since_command last_full_marc_file.to_datetime
logger.info "Commit"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The individual date commands commit, so we don't need to commit again afterwards (although it doesn't hurt)

# Calling the Thor "file" command.
call_file_command file

logger.info "Commit"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, we were committing after loading deleted records, but not after we loaded the full file. We probably want to commit after we load the full file.

lib/services.rb Outdated
@@ -104,4 +104,6 @@ def env_local_file
Services.register(:collection_map) do
CICTL::CollectionMap.new.to_translation_map
end

Services.register(:job_name) { ENV.fetch("JOB_NAME",$PROGRAM_NAME) }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a default, running individual specs fails in inscrutable ways.

Copy link
Contributor

@moseshll moseshll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving aside the two standardrb gotchas. Less chaotic with the extracted methods. APPROVE

We were checking for a full journal file but not writing one when we did
the full index, leading to a situation where regardless of journal file
presence the "continue" command would do a full reindex every day.
@aelkiss aelkiss force-pushed the DEV-1440-full-journal branch from 68e2169 to 23e34e5 Compare December 11, 2024 22:24
@coveralls
Copy link

Coverage Status

coverage: 92.483% (+0.05%) from 92.438%
when pulling 23e34e5 on DEV-1440-full-journal
into 5c9ce52 on main.

@aelkiss aelkiss merged commit f73dca4 into main Dec 11, 2024
1 check passed
@aelkiss aelkiss deleted the DEV-1440-full-journal branch December 11, 2024 22:34
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.

3 participants