diff --git a/ruby/lib/jam_ruby/models/music_session.rb b/ruby/lib/jam_ruby/models/music_session.rb index 2ed761e4e..e7c6cece2 100644 --- a/ruby/lib/jam_ruby/models/music_session.rb +++ b/ruby/lib/jam_ruby/models/music_session.rb @@ -899,6 +899,18 @@ module JamRuby Recording.where(music_session_id: self.id) end + def self.cleanup_old_sessions + session__started = "(music_sessions.scheduled_start > NOW() - '12 hour'::INTERVAL AND music_sessions.started_at IS NULL)" + + # keep started sessions that are not finished yet + session_started_not_finished = "(music_sessions.started_at IS NOT NULL AND music_sessions.session_removed_at IS NULL)" + + # let session be restarted for up to 2 hours after finishing + session_not_finished = "(music_sessions.session_removed_at > NOW() - '2 hour'::INTERVAL)" + + MusicSession.where() + end + def end_history self.update_attribute(:session_removed_at, Time.now) diff --git a/web/app/views/dialogs/_banner.html.slim b/web/app/views/dialogs/_banner.html.slim index 90f752eb2..1e44d16bc 100644 --- a/web/app/views/dialogs/_banner.html.slim +++ b/web/app/views/dialogs/_banner.html.slim @@ -39,17 +39,15 @@ script type='text/template' id='template-app-in-read-only-volume' script type='text/template' id='template-shutdown-prompt' .shutdown-prompt - | We strongly recommend that you leave the JamKazam application running in the background. - | This is a very lightweight app that will not disrupt your use of your computer and other applications, and leaving this app running will deliver the following benefits to you: + | You might consider leaving the application in the background for a couple of reasons: ul - li - span.definition Scoring Service - = '- If you leave the app running, there is a service that can check your Internet latency to other JamKazam users. This is critical data that will guide you on which musicians and which sessions will offer a good online play experience.' li span.definition Recordings - = '- If you leave the app running, any recordings that you and others have made during sessions can be mastered - i.e. uploaded, mixed on our servers, and downloaded back to your computer - so that you have high quality versions of your recordings available.' + = '- If you leave the app running after a session completes, any recordings that you and others have made during sessions can be mastered - i.e. uploaded, mixed on our servers, and downloaded back to your computer - so that you have high quality versions of your recordings available.' + li + span.definition Friends + = '- You can open the app and check your notifications from friends at any time.' - | Please consider leaving this lightweight app running in the background for your own benefit, thanks! script type='text/template' id='template-mixer-mode-change' .mixer-mode-change