Skip to content

Commit

Permalink
Add notification when finished without errors
Browse files Browse the repository at this point in the history
  • Loading branch information
just806me committed Sep 30, 2023
1 parent 6f5965a commit 808ff10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/channels/api_channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def finish data
dispatch_all 'comments/load', Comment.includes(:user).where(task_id:)
dispatch_all 'app/finish'

dispatch_self 'notifications/push', kind: 'info', message: 'Calculating results …'

users_without_result = []
begin
ActiveRecord::Base.transaction do
Expand All @@ -158,6 +160,8 @@ def finish data
task.update_column :scoring_open, true
dispatch_self 'app/ready', ready_info
raise e
else
dispatch_self 'notifications/push', kind: 'success', message: 'Results calculated'
end
end

Expand Down

0 comments on commit 808ff10

Please sign in to comment.