Sha256: 519da3e04618ba1ee7e5843b16837372b743810aa2d79b3a9b83427c0f2973cd

Contents?: true

Size: 487 Bytes

Versions: 5

Compression:

Stored size: 487 Bytes

Contents

module Maestrano::Connector::Rails
  class AllSynchronizationsJob < ::ActiveJob::Base
    queue_as :default

    # Trigger synchronization of all active organizations
    def perform(name=nil, count=nil)
      Maestrano::Connector::Rails::Organization.where('oauth_provider IS NOT NULL AND oauth_token IS NOT NULL').each do |o|
        next unless [true, 1].include?(o.sync_enabled)
        Maestrano::Connector::Rails::SynchronizationJob.perform_later(o, {})
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
maestrano-connector-rails-1.0.4 app/jobs/maestrano/connector/rails/all_synchronizations_job.rb
maestrano-connector-rails-1.0.3 app/jobs/maestrano/connector/rails/all_synchronizations_job.rb
maestrano-connector-rails-1.0.2 app/jobs/maestrano/connector/rails/all_synchronizations_job.rb
maestrano-connector-rails-1.0.1 app/jobs/maestrano/connector/rails/all_synchronizations_job.rb
maestrano-connector-rails-1.0.0 app/jobs/maestrano/connector/rails/all_synchronizations_job.rb