mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Use Redis for ActiveJob and ActionCable (#2004)
* Use Redis for ActiveJob and ActionCable * Fix alwaysApply setting * Update queue names and weights * Tweak weights * Update job queues * Update docker setup guide * Remove deprecated upgrade columns from users table * Refactor Redis configuration for Sidekiq and caching in production environment * Add Sidekiq Sentry monitoring * queue naming fix * Clean up schema
This commit is contained in:
parent
a7db914005
commit
19cc63c8f4
75 changed files with 328 additions and 1684 deletions
|
@ -10,7 +10,7 @@ class PagesController < ApplicationController
|
|||
end
|
||||
|
||||
def changelog
|
||||
@release_notes = Provider::Github.new.fetch_latest_release_notes
|
||||
@release_notes = Providers.github.fetch_latest_release_notes
|
||||
|
||||
render layout: "settings"
|
||||
end
|
||||
|
|
|
@ -9,18 +9,6 @@ class Settings::HostingsController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
if hosting_params[:upgrades_setting].present?
|
||||
mode = hosting_params[:upgrades_setting] == "manual" ? "manual" : "auto"
|
||||
target = hosting_params[:upgrades_setting] == "commit" ? "commit" : "release"
|
||||
|
||||
Setting.upgrades_mode = mode
|
||||
Setting.upgrades_target = target
|
||||
end
|
||||
|
||||
if hosting_params.key?(:render_deploy_hook)
|
||||
Setting.render_deploy_hook = hosting_params[:render_deploy_hook]
|
||||
end
|
||||
|
||||
if hosting_params.key?(:require_invite_for_signup)
|
||||
Setting.require_invite_for_signup = hosting_params[:require_invite_for_signup]
|
||||
end
|
||||
|
@ -46,7 +34,7 @@ class Settings::HostingsController < ApplicationController
|
|||
|
||||
private
|
||||
def hosting_params
|
||||
params.require(:setting).permit(:render_deploy_hook, :upgrades_setting, :require_invite_for_signup, :require_email_confirmation, :synth_api_key)
|
||||
params.require(:setting).permit(:require_invite_for_signup, :require_email_confirmation, :synth_api_key)
|
||||
end
|
||||
|
||||
def raise_if_not_self_hosted
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
class UpgradesController < ApplicationController
|
||||
before_action :verify_upgrades_enabled
|
||||
|
||||
def acknowledge
|
||||
commit_sha = params[:id]
|
||||
upgrade = Upgrader.find_upgrade(commit_sha)
|
||||
|
||||
if upgrade
|
||||
if upgrade.available?
|
||||
Current.user.acknowledge_upgrade_prompt(upgrade.commit_sha)
|
||||
flash[:notice] = t(".upgrade_dismissed")
|
||||
elsif upgrade.complete?
|
||||
Current.user.acknowledge_upgrade_alert(upgrade.commit_sha)
|
||||
flash[:notice] = t(".upgrade_complete_dismiss")
|
||||
else
|
||||
flash[:alert] = t(".upgrade_not_available")
|
||||
end
|
||||
else
|
||||
flash[:alert] = t(".upgrade_not_found")
|
||||
end
|
||||
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
def deploy
|
||||
commit_sha = params[:id]
|
||||
upgrade = Upgrader.find_upgrade(commit_sha)
|
||||
|
||||
unless upgrade
|
||||
flash[:alert] = t(".upgrade_not_found")
|
||||
return redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
prior_acknowledged_upgrade_commit_sha = Current.user.last_prompted_upgrade_commit_sha
|
||||
|
||||
# Optimistically acknowledge the upgrade prompt
|
||||
Current.user.acknowledge_upgrade_prompt(upgrade.commit_sha)
|
||||
|
||||
upgrade_result = Upgrader.upgrade_to(upgrade)
|
||||
|
||||
if upgrade_result[:success]
|
||||
flash[:notice] = upgrade_result[:message]
|
||||
else
|
||||
# If the upgrade fails, revert to the prior acknowledged upgrade
|
||||
Current.user.acknowledge_upgrade_prompt(prior_acknowledged_upgrade_commit_sha)
|
||||
flash[:alert] = upgrade_result[:message]
|
||||
end
|
||||
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
private
|
||||
def verify_upgrades_enabled
|
||||
head :not_found unless ENV["UPGRADES_ENABLED"] == "true"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue