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

Speed up iteration publishing #6862

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion app/commands/solution/complete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def award_trophies!
end

def record_activity!
User::Activity::Create.(
User::Activity::Create.defer(
:completed_exercise,
user,
track: exercise.track,
Expand Down
2 changes: 1 addition & 1 deletion app/commands/solution/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def award_badges!
end

def record_activity!
User::Activity::Create.(
User::Activity::Create.defer(
:published_exercise,
user,
track: solution.track,
Expand Down
10 changes: 5 additions & 5 deletions app/commands/solution/publish_iteration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class Solution::PublishIteration
def call
solution.update!(published_iteration: iteration)

Solution::UpdateTags.(solution)
Solution::UpdatePublishedExerciseRepresentation.(solution)
Solution::UpdateSnippet.(solution)
Solution::UpdateNumLoc.(solution)
Solution::InvalidateCloudfrontItem.(solution) if invalidate
Solution::UpdateTags.defer(solution)
Solution::UpdatePublishedExerciseRepresentation.defer(solution)
Iteration::GenerateSnippet.defer(solution)
Solution::UpdateNumLoc.defer(solution)
Solution::InvalidateCloudfrontItem.defer(solution) if invalidate
end

private
Expand Down
Loading