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

[Data rearchitecture] fix minor bug in UpdateTimeslicesCourseWiki #6188

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/services/update_timeslices_course_wiki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def update_timeslices_durations
@course.wikis.each do |wiki|
start = @timeslice_manager.get_ingestion_start_time_for_wiki wiki
timeslice = @course.course_wiki_timeslices.where(wiki:, start:).first
next unless timeslice
effective_timeslice_duration = timeslice.end - timeslice.start
real_timeslice_duration = @timeslice_manager.timeslice_duration(wiki)
# Continue if timeslice duration didn't change for the wiki
Expand Down
6 changes: 6 additions & 0 deletions spec/services/update_timeslices_course_wiki_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,10 @@
expect(last_timeslice.end - last_timeslice.start).to eq(172800)
end
end

it 'doesnt fail if there are no timeslices for the ingestion start date' do
manager.create_timeslices_for_new_course_wiki_records([enwiki])
course.update(start: '2018-11-20')
described_class.new(course).run
end
end
Loading