From 87908c7bd169184ce4b55081cc757037982d0a8c Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sat, 4 Nov 2023 18:46:32 +0100 Subject: [PATCH] Switch to actioncable-enhanced-postgresql-adapter This change will store large events (larger than 8KB) for ActionCable in the database. Therefore, it resolves issues where the payload was previously too large. Fixes #1920 Fixes CODEOCEAN-Y8 Fixes CODEOCEAN-WS --- Gemfile | 1 + Gemfile.lock | 5 +++++ config/cable.yml | 14 ++++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 7494032a..8ad7636a 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source 'https://rubygems.org' +gem 'actioncable-enhanced-postgresql-adapter' gem 'bcrypt' gem 'bootsnap', require: false gem 'bootstrap-will_paginate' diff --git a/Gemfile.lock b/Gemfile.lock index 3e5b2aa9..5f4b155c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -103,6 +103,10 @@ GIT GEM remote: https://rubygems.org/ specs: + actioncable-enhanced-postgresql-adapter (1.0.1) + actioncable (>= 6.0) + connection_pool (>= 2.2.5) + pg (~> 1.5) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) @@ -559,6 +563,7 @@ PLATFORMS ruby DEPENDENCIES + actioncable-enhanced-postgresql-adapter bcrypt better_errors binding_of_caller diff --git a/config/cable.yml b/config/cable.yml index 150ec4c4..db2bd945 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,14 +1,20 @@ development: - adapter: async + adapter: enhanced_postgresql test: adapter: test staging: - adapter: postgresql + adapter: enhanced_postgresql production: - adapter: postgresql # redis - # all other options below are only used for redis + adapter: enhanced_postgresql # OR postgresql OR redis + + ### Config options for `enhanced_postgresql` + # payload_encryptor_secret: # Required. Will be the defined value or `Rails.application.secret_key_base` or `ENV["SECRET_KEY_BASE"]` + # url: <%= ENV.fetch("DATABASE_URL") { "postgresql://localhost:5432/code_ocean_production" } %> + # connection_pool_size: <%= ENV.fetch("RAILS_MAX_THREADS", 5).to_i %> # Only used in conjunction with `url` + + ### Config options for `redis` # url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> # channel_prefix: code_ocean_production