better session ratings and prep for AKS test

This commit is contained in:
Seth Call 2020-08-22 09:30:20 -05:00
parent 16da5e8918
commit c595d8158e
4 changed files with 11 additions and 5 deletions

View File

@ -52,3 +52,5 @@ ALTER TABLE arses ADD COLUMN port int default 3478;
ALTER TABLE generic_state ADD COLUMN top_message VARCHAR(100000);
ALTER TABLE users ADD COLUMN beta BOOLEAN default FALSE;
ALTER TABLE arses ADD COLUMN beta BOOLEAN default FALSE;

View File

@ -7,5 +7,8 @@ module JamRuby
self.table_name = "arses"
@@log = Logging.logger[Ars]
def active_arses(user)
Ars.where(active: true, beta: user.beta).where('ip is not NULL').where("ip != ''").all
end
end
end

View File

@ -395,10 +395,11 @@ class ApiMusicSessionsController < ApiController
session_type = "Session"
end
subject = "#{current_user.name} Rated Their #{session_type}!"
rating_type = rating > 0 ? "Good" : "Bad"
with_comment = (comment.nil? || comment.strip.empty?) ? '' : ' - With Comment'
subject = "#{current_user.name} Rated Their #{session_type} #{rating_type}#{with_comment}!"
body = "Session Type: #{session_type}\n"
body << "Session Rating: #{ rating > 0 ? "Good" : "Bad"}\n"
body << "Session Rating: #{rating_type}\n"
body << "Session Rating Arg: #{rating_val}\n"
body << "User: #{current_user.email}\n"
body << "Music Session URL: #{session_link}\n"

View File

@ -1355,7 +1355,7 @@ module JamWebsockets
# it's possible that a client will not be represented in the database anymore, due to hard to trace/guess scenario
# usually involve reconnects. Double-check that all clients in memory are actually in the database. if not, delete them from memory
@stored_ars = Ars.where(active: true).where('ip is not NULL').where("ip != ''").all
@stored_ars = Ars.active_arses(user)
if @client_lookup.length == 0
return
@ -1403,7 +1403,7 @@ module JamWebsockets
end
cleanup_clients_with_ids(clients)
end
def periodical_stats_dump
# assume 60 seconds per status dump