From 29c67c47690208f736e419448d3ef5fc4a30486a Mon Sep 17 00:00:00 2001 From: Just Me Date: Sun, 1 Oct 2023 02:05:33 +0300 Subject: [PATCH] Add notification when finished without errors --- app/channels/api_channel.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/channels/api_channel.rb b/app/channels/api_channel.rb index 2e3746e9..697eb78c 100644 --- a/app/channels/api_channel.rb +++ b/app/channels/api_channel.rb @@ -153,6 +153,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 result_multiplier = Rational task.result_multiplier @@ -171,6 +173,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