From 52d38d264c6e5f07f551208720af7a7e6c74efe3 Mon Sep 17 00:00:00 2001 From: Campbell Allen Date: Thu, 13 Aug 2015 11:55:47 +0100 Subject: [PATCH 1/2] Add rack-timeout using default settings Adds react timeout with a default of 15s to process a request. Also bump gem minor updates lock mysql2 gem minor updates that won't build --- Gemfile | 3 ++- Gemfile.lock | 72 ++++++++++++++++++++++++++-------------------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/Gemfile b/Gemfile index f262f9671..35e246fb6 100644 --- a/Gemfile +++ b/Gemfile @@ -34,6 +34,7 @@ gem 'activerecord-import', '~> 0.8' gem 'schema_plus_pg_indexes', '~> 0.1' gem 'pg_search' gem 'ranked-model', '~> 0.4.0' +gem 'rack-timeout', '~> 0.2.4' platforms :jruby do gem 'activerecord-jdbcpostgresql-adapter' @@ -46,7 +47,7 @@ platforms :ruby do gem 'therubyracer', '~> 0.12' gem 'pg', '~> 0.18' gem 'poseidon', '~> 0.0.5' - gem 'mysql2', '~> 0.3' + gem 'mysql2', '0.3.18' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 7ea4351e6..a28c0640e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,7 +48,7 @@ GEM activemodel (= 4.2.3) activesupport (= 4.2.3) arel (~> 6.0) - activerecord-import (0.8.0) + activerecord-import (0.10.0) activerecord (>= 3.0) activesupport (4.2.3) i18n (~> 0.7) @@ -57,18 +57,18 @@ GEM thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.3.8) - arel (6.0.0) + arel (6.0.3) aws-sdk-v1 (1.64.0) json (~> 1.4) nokogiri (>= 1.4.4) bcrypt (3.1.10) builder (3.2.2) - celluloid (0.16.0) + celluloid (0.16.1) timers (~> 4.0.0) coderay (1.1.0) connection_pool (2.2.0) database_cleaner (1.2.0) - devise (3.5.1) + devise (3.5.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) @@ -89,19 +89,19 @@ GEM multipart-post (>= 1.2, < 3) faraday-http-cache (1.1.1) faraday (~> 0.8) - faraday_middleware (0.9.1) + faraday_middleware (0.10.0) faraday (>= 0.7.4, < 0.10) - ffi (1.9.8) + ffi (1.9.10) fig_rake (0.9.3) firebase_token_generator (2.0.0) foreman (0.78.0) thor (~> 0.19.1) formatador (0.2.5) - globalid (0.3.5) + globalid (0.3.6) activesupport (>= 4.1.0) - guard (2.12.6) + guard (2.13.0) formatador (>= 0.2.4) - listen (~> 2.7) + listen (>= 2.7, <= 4.0) lumberjack (~> 1.0) nenv (~> 0.1) notiffany (~> 0.0) @@ -113,7 +113,7 @@ GEM rspec (>= 2.14, < 4.0) hashie (3.4.2) hitimes (1.2.2) - honeybadger (2.1.0) + honeybadger (2.1.3) i18n (0.7.0) its-it (1.1.1) jquery-rails (4.0.4) @@ -123,14 +123,13 @@ GEM json (1.8.3) json-schema (2.5.1) addressable (~> 2.3.7) - jwt (1.5.0) + jwt (1.5.1) kaminari (0.16.3) actionpack (>= 3.0.0) activesupport (>= 3.0.0) key_struct (0.4.2) - libv8 (3.16.14.7) - listen (2.10.1) - celluloid (~> 0.16.0) + libv8 (3.16.14.11) + listen (3.0.3) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) logstash-event (1.2.02) @@ -145,19 +144,19 @@ GEM method_source (0.8.2) mime-types (2.6.1) mini_portile (0.6.2) - minitest (5.7.0) + minitest (5.8.0) modware (0.1.2) its-it key_struct (~> 0.4) - multi_json (1.11.1) + multi_json (1.11.2) multi_xml (0.5.5) multipart-post (2.0.0) mysql2 (0.3.18) nenv (0.2.0) - newrelic_rpm (3.12.0.288) + newrelic_rpm (3.13.0.299) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) - notiffany (0.0.6) + notiffany (0.0.7) nenv (~> 0.1) shellany (~> 0.0) oauth2 (1.0.0) @@ -173,7 +172,7 @@ GEM omniauth-oauth2 (~> 1.2) omniauth-gplus (2.0.1) omniauth-oauth2 (~> 1.1) - omniauth-oauth2 (1.3.0) + omniauth-oauth2 (1.3.1) oauth2 (~> 1.0) omniauth (~> 1.2) orm_adapter (0.5.0) @@ -206,6 +205,7 @@ GEM rack rack-test (0.6.3) rack (>= 1.0) + rack-timeout (0.2.4) rails (4.2.3) actionmailer (= 4.2.3) actionpack (= 4.2.3) @@ -237,27 +237,26 @@ GEM rb-inotify (0.9.5) ffi (>= 0.5.0) rdoc (4.2.0) - json (~> 1.4) redis (3.2.1) redis-namespace (1.5.2) redis (~> 3.0, >= 3.0.4) - ref (1.0.5) - request_store (1.1.0) + ref (2.0.0) + request_store (1.2.0) responders (2.1.0) railties (>= 4.2.0, < 5) rspec (3.3.0) rspec-core (~> 3.3.0) rspec-expectations (~> 3.3.0) rspec-mocks (~> 3.3.0) - rspec-core (3.3.0) + rspec-core (3.3.2) rspec-support (~> 3.3.0) - rspec-expectations (3.3.0) + rspec-expectations (3.3.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.3.0) - rspec-mocks (3.3.0) + rspec-mocks (3.3.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.3.0) - rspec-rails (3.3.1) + rspec-rails (3.3.3) actionpack (>= 3.0, < 4.3) activesupport (>= 3.0, < 4.3) railties (>= 3.0, < 4.3) @@ -266,7 +265,7 @@ GEM rspec-mocks (~> 3.3.0) rspec-support (~> 3.3.0) rspec-support (3.3.0) - schema_monkey (2.1.0) + schema_monkey (2.1.1) activerecord (~> 4.2) its-it modware (~> 0.1) @@ -276,19 +275,19 @@ GEM schema_plus_indexes (0.2.0) activerecord (~> 4.2) schema_plus_core (~> 0.1) - schema_plus_pg_indexes (0.1.4) + schema_plus_pg_indexes (0.1.5) activerecord (~> 4.2) schema_plus_indexes (~> 0.1, >= 0.1.3) sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) shellany (0.0.1) - sidekiq (3.4.0) - celluloid (>= 0.16.0) - connection_pool (>= 2.1.1) - json - redis (>= 3.0.6) - redis-namespace (>= 1.3.1) + sidekiq (3.4.2) + celluloid (~> 0.16.0) + connection_pool (~> 2.2, >= 2.2.0) + json (~> 1.0) + redis (~> 3.2, >= 3.2.1) + redis-namespace (~> 1.5, >= 1.5.2) sinatra (1.4.6) rack (~> 1.4) rack-protection (~> 1.4) @@ -297,7 +296,7 @@ GEM spring (1.3.6) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (3.2.0) + sprockets (3.3.0) rack (~> 1.0) sprockets-rails (2.3.2) actionpack (>= 3.0) @@ -353,7 +352,7 @@ DEPENDENCIES jruby-kafka (= 1.0.0.beta) json-schema (~> 2.0) logstasher (~> 0.6) - mysql2 (~> 0.3) + mysql2 (= 0.3.18) newrelic_rpm (~> 3.0) omniauth (~> 1.0) omniauth-facebook (~> 2.0) @@ -367,6 +366,7 @@ DEPENDENCIES pry-rails (~> 0.3.2) puma (~> 2.0) rack-cors (~> 0.3) + rack-timeout (~> 0.2.4) rails (~> 4.2.3) ranked-model (~> 0.4.0) restpack_serializer! From ffa4fbd050540970ecf6bf8828aea25a1aa9316e Mon Sep 17 00:00:00 2001 From: Campbell Allen Date: Thu, 13 Aug 2015 13:42:29 +0100 Subject: [PATCH 2/2] make old migration work again updated schema_plus_pg_indexes gem breaks old migration --- ...20150421191603_add_workflow_state_to_set_member_subjects.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/migrate/20150421191603_add_workflow_state_to_set_member_subjects.rb b/db/migrate/20150421191603_add_workflow_state_to_set_member_subjects.rb index 827e6ff01..194c262aa 100644 --- a/db/migrate/20150421191603_add_workflow_state_to_set_member_subjects.rb +++ b/db/migrate/20150421191603_add_workflow_state_to_set_member_subjects.rb @@ -1,6 +1,7 @@ class AddWorkflowStateToSetMemberSubjects < ActiveRecord::Migration def change - add_column :set_member_subjects, :retired_workflow_ids, :integer, array: true, index: :gin, default: [] + add_column :set_member_subjects, :retired_workflow_ids, :integer, array: true, default: [] + add_index :set_member_subjects, :retired_workflow_ids, using: :gin SetMemberSubject.where(state: 2).where.not(subject_set: nil).find_each do |sms| sms.update(retired_workflows: sms.subject_set.try(:workflows) || [])