Sha256: 3463deaac9881703508956ea8baecef8ef400fd6e96b8c44a2414d37465d06e1

Contents?: true

Size: 688 Bytes

Versions: 1

Compression:

Stored size: 688 Bytes

Contents

require "galera_cluster_migrations/version"
require 'active_support/concern'

module GaleraClusterMigrations
  extend ActiveSupport::Concern

  require 'galera_cluster_migrations/railtie' if defined?(Rails)

  included do
    def enable_rsu
      say "Setting wsrep_OSU_method to RSU"
      unless [:development, :test].include?(Rails.env)
        execute "SET GLOBAL wsrep_OSU_method=RSU"
      end
    end

    def with_rsu
      enable_rsu
      yield
    ensure
      enable_toi
    end

    def enable_toi
      say "Setting wsrep_OSU_method to TOI"
      unless [:development, :test].include?(Rails.env)
        execute "SET GLOBAL wsrep_OSU_method=TOI"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
galera_cluster_migrations-1.0.1.beta1 lib/galera_cluster_migrations.rb