Sha256: 6d21ca9bad4955c8be6a035028d8069170f003e17920af51e433b2c35232686e

Contents?: true

Size: 652 Bytes

Versions: 30

Compression:

Stored size: 652 Bytes

Contents

# Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.

class DBWorkerJob
  include Sidekiq::Worker

  def perform(*args)
    return unless defined?(::Sequel) && !defined?(JRUBY_VERSION)

    if ENV.key?('TRAVIS_MYSQL_PASS')
      @db = Sequel.connect("mysql2://root:#{ENV['TRAVIS_MYSQL_PASS']}@127.0.0.1:3306/travis_ci_test")
    else
      @db = Sequel.connect('mysql2://root@127.0.0.1:3306/travis_ci_test')
    end

    unless @db.table_exists?(:items)
      @db.create_table :items do
        primary_key :id
        String :name
        Float :price
      end
    end

    @db.run('select 1')

    items = @db[:items]
    items.count
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
traceview-3.8.3-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.8.3 test/jobs/sidekiq/db_worker_job.rb
traceview-3.8.2-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.8.2 test/jobs/sidekiq/db_worker_job.rb
traceview-3.8.1-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.8.1 test/jobs/sidekiq/db_worker_job.rb
traceview-3.8.0-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.8.0 test/jobs/sidekiq/db_worker_job.rb
traceview-3.7.1-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.7.1 test/jobs/sidekiq/db_worker_job.rb
traceview-3.7.0-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.7.0 test/jobs/sidekiq/db_worker_job.rb
traceview-3.6.0-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.6.0 test/jobs/sidekiq/db_worker_job.rb
traceview-3.5.1-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.5.1 test/jobs/sidekiq/db_worker_job.rb
traceview-3.5.0-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.5.0 test/jobs/sidekiq/db_worker_job.rb
traceview-3.4.2-java test/jobs/sidekiq/db_worker_job.rb
traceview-3.4.2 test/jobs/sidekiq/db_worker_job.rb