sidekiq-unique-jobs 5.0.2 → 5.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq-unique-jobs might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/Appraisals +1 -1
- data/CHANGELOG.md +9 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +21 -0
- data/bin/bench +1 -1
- data/lib/sidekiq-unique-jobs.rb +3 -1
- data/lib/sidekiq/simulator.rb +4 -10
- data/lib/sidekiq_unique_jobs/cli.rb +2 -0
- data/lib/sidekiq_unique_jobs/client/middleware.rb +2 -0
- data/lib/sidekiq_unique_jobs/config.rb +2 -0
- data/lib/sidekiq_unique_jobs/constants.rb +19 -17
- data/lib/sidekiq_unique_jobs/core_ext.rb +2 -0
- data/lib/sidekiq_unique_jobs/lock.rb +2 -0
- data/lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb +2 -0
- data/lib/sidekiq_unique_jobs/lock/until_executed.rb +3 -1
- data/lib/sidekiq_unique_jobs/lock/until_executing.rb +2 -0
- data/lib/sidekiq_unique_jobs/lock/until_timeout.rb +2 -0
- data/lib/sidekiq_unique_jobs/lock/while_executing.rb +2 -0
- data/lib/sidekiq_unique_jobs/middleware.rb +2 -0
- data/lib/sidekiq_unique_jobs/normalizer.rb +2 -0
- data/lib/sidekiq_unique_jobs/options_with_fallback.rb +2 -0
- data/lib/sidekiq_unique_jobs/run_lock_failed.rb +2 -0
- data/lib/sidekiq_unique_jobs/script_mock.rb +2 -0
- data/lib/sidekiq_unique_jobs/scripts.rb +15 -10
- data/lib/sidekiq_unique_jobs/scripts/acquire_lock.rb +2 -0
- data/lib/sidekiq_unique_jobs/scripts/release_lock.rb +2 -0
- data/lib/sidekiq_unique_jobs/server/middleware.rb +2 -0
- data/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb +2 -0
- data/lib/sidekiq_unique_jobs/testing.rb +2 -0
- data/lib/sidekiq_unique_jobs/testing/sidekiq_overrides.rb +2 -0
- data/lib/sidekiq_unique_jobs/timeout_calculator.rb +2 -0
- data/lib/sidekiq_unique_jobs/unique_args.rb +3 -1
- data/lib/sidekiq_unique_jobs/unlockable.rb +2 -0
- data/lib/sidekiq_unique_jobs/util.rb +5 -3
- data/lib/sidekiq_unique_jobs/version.rb +3 -1
- data/sidekiq-unique-jobs.gemspec +27 -23
- metadata +44 -200
- data/LICENSE +0 -13
- data/circle.yml +0 -41
- data/gemfiles/sidekiq_4.0.gemfile +0 -22
- data/gemfiles/sidekiq_4.1.gemfile +0 -22
- data/gemfiles/sidekiq_4.2.gemfile +0 -22
- data/gemfiles/sidekiq_5.0.gemfile +0 -22
- data/gemfiles/sidekiq_develop.gemfile +0 -22
- data/rails_example/.env +0 -12
- data/rails_example/.env.test +0 -12
- data/rails_example/.gitignore +0 -13
- data/rails_example/.rspec +0 -2
- data/rails_example/Gemfile +0 -38
- data/rails_example/Procfile +0 -2
- data/rails_example/README.rdoc +0 -28
- data/rails_example/Rakefile +0 -6
- data/rails_example/app/assets/images/.keep +0 -0
- data/rails_example/app/assets/javascripts/application.js +0 -16
- data/rails_example/app/assets/stylesheets/application.css +0 -15
- data/rails_example/app/channels/appearance_channel.rb +0 -17
- data/rails_example/app/channels/application_cable/channel.rb +0 -4
- data/rails_example/app/channels/application_cable/connection.rb +0 -9
- data/rails_example/app/channels/post_channel.rb +0 -5
- data/rails_example/app/controllers/application_controller.rb +0 -5
- data/rails_example/app/controllers/concerns/.keep +0 -0
- data/rails_example/app/controllers/work_controller.rb +0 -39
- data/rails_example/app/helpers/application_helper.rb +0 -2
- data/rails_example/app/mailers/.keep +0 -0
- data/rails_example/app/models/.keep +0 -0
- data/rails_example/app/models/application_record.rb +0 -3
- data/rails_example/app/models/concerns/.keep +0 -0
- data/rails_example/app/models/guest.rb +0 -18
- data/rails_example/app/models/post.rb +0 -2
- data/rails_example/app/views/layouts/application.html.erb +0 -15
- data/rails_example/app/workers/simple_worker.rb +0 -15
- data/rails_example/app/workers/slow_until_executing_worker.rb +0 -15
- data/rails_example/app/workers/spawn_simple_worker.rb +0 -10
- data/rails_example/app/workers/while_executing_worker.rb +0 -12
- data/rails_example/app/workers/without_args_worker.rb +0 -16
- data/rails_example/app/workers/without_argument_worker.rb +0 -12
- data/rails_example/bin/bundle +0 -3
- data/rails_example/bin/check_or_setup_db +0 -56
- data/rails_example/bin/docker-setup +0 -20
- data/rails_example/bin/rails +0 -4
- data/rails_example/bin/rake +0 -4
- data/rails_example/bin/setup +0 -34
- data/rails_example/bin/update +0 -29
- data/rails_example/cable.ru +0 -6
- data/rails_example/common-services.yml +0 -52
- data/rails_example/config.ru +0 -4
- data/rails_example/config/application.rb +0 -27
- data/rails_example/config/boot.rb +0 -3
- data/rails_example/config/cable.yml +0 -9
- data/rails_example/config/database.docker.yml +0 -12
- data/rails_example/config/database.yml +0 -19
- data/rails_example/config/environment.rb +0 -5
- data/rails_example/config/environments/development.rb +0 -54
- data/rails_example/config/environments/production.rb +0 -86
- data/rails_example/config/environments/test.rb +0 -42
- data/rails_example/config/initializers/application_controller_renderer.rb +0 -6
- data/rails_example/config/initializers/assets.rb +0 -11
- data/rails_example/config/initializers/backtrace_silencers.rb +0 -9
- data/rails_example/config/initializers/cookies_serializer.rb +0 -5
- data/rails_example/config/initializers/filter_parameter_logging.rb +0 -4
- data/rails_example/config/initializers/inflections.rb +0 -16
- data/rails_example/config/initializers/mime_types.rb +0 -4
- data/rails_example/config/initializers/new_framework_defaults.rb +0 -23
- data/rails_example/config/initializers/session_store.rb +0 -3
- data/rails_example/config/initializers/sidekiq.rb +0 -13
- data/rails_example/config/initializers/wrap_parameters.rb +0 -14
- data/rails_example/config/locales/en.yml +0 -23
- data/rails_example/config/puma.rb +0 -38
- data/rails_example/config/routes.rb +0 -8
- data/rails_example/config/secrets.yml +0 -22
- data/rails_example/config/sidekiq.yml +0 -6
- data/rails_example/config/spring.rb +0 -6
- data/rails_example/db/migrate/20160724111322_create_posts.rb +0 -12
- data/rails_example/db/schema.rb +0 -25
- data/rails_example/db/seeds.rb +0 -7
- data/rails_example/dev-entrypoint.sh +0 -55
- data/rails_example/dev.env +0 -12
- data/rails_example/docker-compose.yml +0 -71
- data/rails_example/docker/rails.Dockerfile +0 -27
- data/rails_example/lib/assets/.keep +0 -0
- data/rails_example/lib/tasks/.keep +0 -0
- data/rails_example/log/.keep +0 -0
- data/rails_example/public/404.html +0 -67
- data/rails_example/public/422.html +0 -67
- data/rails_example/public/500.html +0 -66
- data/rails_example/public/favicon.ico +0 -0
- data/rails_example/public/robots.txt +0 -5
- data/rails_example/simple.ru +0 -12
- data/rails_example/spec/controllers/work_controller_mock_spec.rb +0 -91
- data/rails_example/spec/controllers/work_controller_spec.rb +0 -77
- data/rails_example/spec/factories/posts.rb +0 -8
- data/rails_example/spec/models/post_spec.rb +0 -4
- data/rails_example/spec/rails_helper.rb +0 -20
- data/rails_example/spec/spec_helper.rb +0 -20
- data/rails_example/spec/support/sidekiq_meta.rb +0 -12
- data/rails_example/spec/workers/simple_worker_spec.rb +0 -4
- data/rails_example/vendor/assets/javascripts/.keep +0 -0
- data/rails_example/vendor/assets/stylesheets/.keep +0 -0
- data/spec/jobs/another_unique_job.rb +0 -13
- data/spec/jobs/custom_queue_job.rb +0 -5
- data/spec/jobs/custom_queue_job_with_filter_method.rb +0 -7
- data/spec/jobs/custom_queue_job_with_filter_proc.rb +0 -10
- data/spec/jobs/expiring_job.rb +0 -4
- data/spec/jobs/inline_worker.rb +0 -8
- data/spec/jobs/just_a_worker.rb +0 -7
- data/spec/jobs/long_running_job.rb +0 -6
- data/spec/jobs/main_job.rb +0 -7
- data/spec/jobs/my_job.rb +0 -12
- data/spec/jobs/my_unique_job.rb +0 -11
- data/spec/jobs/my_unique_job_with_filter_method.rb +0 -17
- data/spec/jobs/my_unique_job_with_filter_proc.rb +0 -15
- data/spec/jobs/notify_worker.rb +0 -10
- data/spec/jobs/plain_class.rb +0 -3
- data/spec/jobs/simple_worker.rb +0 -11
- data/spec/jobs/spawn_simple_worker.rb +0 -8
- data/spec/jobs/test_class.rb +0 -3
- data/spec/jobs/unique_job_with_conditional_parameter.rb +0 -14
- data/spec/jobs/unique_job_with_filter_method.rb +0 -18
- data/spec/jobs/unique_job_with_nil_unique_args.rb +0 -16
- data/spec/jobs/unique_job_with_no_unique_args_method.rb +0 -12
- data/spec/jobs/unique_job_withthout_unique_args_parameter.rb +0 -14
- data/spec/jobs/unique_on_all_queues_job.rb +0 -13
- data/spec/jobs/until_and_while_executing_job.rb +0 -7
- data/spec/jobs/until_executed_job.rb +0 -17
- data/spec/jobs/until_executing_job.rb +0 -7
- data/spec/jobs/until_global_timeout_job.rb +0 -8
- data/spec/jobs/until_timeout_job.rb +0 -8
- data/spec/jobs/while_executing_job.rb +0 -12
- data/spec/jobs/without_argument_job.rb +0 -9
- data/spec/lib/sidekiq_unique_jobs/cli_spec.rb +0 -183
- data/spec/lib/sidekiq_unique_jobs/client/middleware_spec.rb +0 -316
- data/spec/lib/sidekiq_unique_jobs/config_spec.rb +0 -84
- data/spec/lib/sidekiq_unique_jobs/core_ext_spec.rb +0 -25
- data/spec/lib/sidekiq_unique_jobs/lock/until_and_while_executing_spec.rb +0 -42
- data/spec/lib/sidekiq_unique_jobs/lock/until_executed_spec.rb +0 -37
- data/spec/lib/sidekiq_unique_jobs/lock/until_timeout_spec.rb +0 -26
- data/spec/lib/sidekiq_unique_jobs/lock/while_executing_spec.rb +0 -86
- data/spec/lib/sidekiq_unique_jobs/normalizer_spec.rb +0 -21
- data/spec/lib/sidekiq_unique_jobs/options_with_fallback_spec.rb +0 -113
- data/spec/lib/sidekiq_unique_jobs/queue_lock_timeout_calculator_spec.rb +0 -47
- data/spec/lib/sidekiq_unique_jobs/run_lock_timeout_calculator_spec.rb +0 -36
- data/spec/lib/sidekiq_unique_jobs/script_mock_spec.rb +0 -88
- data/spec/lib/sidekiq_unique_jobs/scripts/acquire_lock_spec.rb +0 -50
- data/spec/lib/sidekiq_unique_jobs/scripts/release_lock_spec.rb +0 -41
- data/spec/lib/sidekiq_unique_jobs/scripts_spec.rb +0 -68
- data/spec/lib/sidekiq_unique_jobs/server/middleware_spec.rb +0 -78
- data/spec/lib/sidekiq_unique_jobs/sidekiq_testing_enabled_spec.rb +0 -164
- data/spec/lib/sidekiq_unique_jobs/sidekiq_unique_ext_spec.rb +0 -75
- data/spec/lib/sidekiq_unique_jobs/sidekiq_unique_jobs_spec.rb +0 -41
- data/spec/lib/sidekiq_unique_jobs/timeout_calculator_spec.rb +0 -70
- data/spec/lib/sidekiq_unique_jobs/unique_args_spec.rb +0 -257
- data/spec/lib/sidekiq_unique_jobs/unlockable_spec.rb +0 -37
- data/spec/lib/sidekiq_unique_jobs/util_spec.rb +0 -81
- data/spec/spec_helper.rb +0 -92
- data/spec/support/matchers/redis_matchers.rb +0 -29
- data/spec/support/ruby_meta.rb +0 -17
- data/spec/support/sidekiq_meta.rb +0 -30
- data/spec/support/unique_macros.rb +0 -71
data/rails_example/db/schema.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended that you check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(version: 20_160_724_111_322) do
|
14
|
-
# These are extensions that must be enabled in order to support this database
|
15
|
-
enable_extension 'plpgsql'
|
16
|
-
|
17
|
-
create_table 'posts', force: :cascade do |t|
|
18
|
-
t.string 'title'
|
19
|
-
t.text 'body'
|
20
|
-
t.string 'excerpt'
|
21
|
-
t.integer 'read_count'
|
22
|
-
t.datetime 'created_at', null: false
|
23
|
-
t.datetime 'updated_at', null: false
|
24
|
-
end
|
25
|
-
end
|
data/rails_example/db/seeds.rb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
-
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
-
#
|
4
|
-
# Examples:
|
5
|
-
#
|
6
|
-
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
7
|
-
# Mayor.create(name: 'Emanuel', city: cities.first)
|
@@ -1,55 +0,0 @@
|
|
1
|
-
#! /bin/bash
|
2
|
-
|
3
|
-
# The Docker App Container's development entrypoint.
|
4
|
-
# This is a script used by the project's Docker development environment to
|
5
|
-
# setup the app containers and databases upon runnning.
|
6
|
-
set -e
|
7
|
-
|
8
|
-
: ${APP_PATH:="/usr/src/app"}
|
9
|
-
: ${APP_TEMP_PATH:="$APP_PATH/tmp"}
|
10
|
-
: ${APP_SETUP_LOCK:="$APP_TEMP_PATH/setup.lock"}
|
11
|
-
: ${APP_SETUP_WAIT:="5"}
|
12
|
-
|
13
|
-
# 1: Define the functions lock and unlock our app containers setup processes:
|
14
|
-
function lock_setup { mkdir -p $APP_TEMP_PATH && touch $APP_SETUP_LOCK; }
|
15
|
-
function unlock_setup { rm -rf $APP_SETUP_LOCK; }
|
16
|
-
function wait_setup { echo "Waiting for app setup to finish..."; sleep $APP_SETUP_WAIT; }
|
17
|
-
|
18
|
-
# 2: 'Unlock' the setup process if the script exits prematurely:
|
19
|
-
trap unlock_setup HUP INT QUIT KILL TERM EXIT
|
20
|
-
|
21
|
-
# 3: Wait until the setup 'lock' file no longer exists:
|
22
|
-
while [ -f $APP_SETUP_LOCK ]; do wait_setup; done
|
23
|
-
|
24
|
-
# 4: 'Lock' the setup process, to prevent a race condition when the project's
|
25
|
-
# app containers will try to install gems and setup the database concurrently:
|
26
|
-
lock_setup
|
27
|
-
|
28
|
-
# 5: Check or install the app dependencies via Bundler:
|
29
|
-
bundle check || bundle install --jobs 8 --retry 5
|
30
|
-
|
31
|
-
# 6: Check if the database exists, or setup the database if it doesn't, as it is
|
32
|
-
# the case when the project runs for the first time.
|
33
|
-
#
|
34
|
-
# We'll use a custom script `check-or-setup-db` (inside our app's `bin` folder),
|
35
|
-
# instead of running `rake db:version || rake db:setup`, as running that command
|
36
|
-
# (at least on rails 4.2.4) will leave a couple of small ruby zombie processes
|
37
|
-
# running in the container:
|
38
|
-
# check_or_setup_db
|
39
|
-
bin/rails db:version || bin/rails db:setup
|
40
|
-
bin/rails db:migrate
|
41
|
-
|
42
|
-
# 7: 'Unlock' the setup process:
|
43
|
-
unlock_setup
|
44
|
-
|
45
|
-
# 8: Specify a default command, in case it wasn't issued:
|
46
|
-
# if [ -z "$1" ]; then set -- rails server -p 3000 -b 0.0.0.0 "$@"; fi
|
47
|
-
|
48
|
-
# 9: If the command to execute is 'rails server', then force it to write the
|
49
|
-
# pid file into a non-shared container directory. Suddenly killing and removing
|
50
|
-
# app containers without this would leave a pidfile in the project's tmp dir,
|
51
|
-
# preventing the app container from starting up on further attempts:
|
52
|
-
# if [[ "$1" = "rails" && ("$2" = "s" || "$2" = "server") ]]; then set -- "$@" -P $PID_FILE; fi
|
53
|
-
|
54
|
-
# 10: Execute the given or default command:
|
55
|
-
exec "$@"
|
data/rails_example/dev.env
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
SECRET_KEY_BASE=10167c7f7654ed02b3557b05b88ece1866a9748a2e8e064016f76cb74ddae38264f7403ba65f301d63c21d770e0ee2ac6906f245e904b3b140d12297f67e0db1
|
2
|
-
APP_DOMAIN=localhost
|
3
|
-
APP_WEB_URL=http://localhost:3000
|
4
|
-
APP_CABLE_URL=ws://localhost:28080
|
5
|
-
WEB_CONSOLE_WHITELISTED_IPS=127.0.0.1 ::1 127.0.0.0/8 ::1
|
6
|
-
DB_HOST=postgres
|
7
|
-
DB_PORT=5432
|
8
|
-
DB_USERNAME=postgres
|
9
|
-
DB_PASSWORD=3x4mpl3
|
10
|
-
DB_POOL=25
|
11
|
-
DB_TIMEOUT=5000
|
12
|
-
DB_REAPING_FREQUENCY=10
|
@@ -1,71 +0,0 @@
|
|
1
|
-
version: '3.1'
|
2
|
-
volumes:
|
3
|
-
postgres-data:
|
4
|
-
driver: local
|
5
|
-
redis-data:
|
6
|
-
driver: local
|
7
|
-
gems:
|
8
|
-
driver: local
|
9
|
-
|
10
|
-
networks:
|
11
|
-
front-tier:
|
12
|
-
driver: bridge
|
13
|
-
back-tier:
|
14
|
-
driver: bridge
|
15
|
-
|
16
|
-
services:
|
17
|
-
rspec:
|
18
|
-
image: ruby:2.4
|
19
|
-
working_dir: /usr/src/app
|
20
|
-
stdin_open: true
|
21
|
-
tty: true
|
22
|
-
volumes:
|
23
|
-
- .:/usr/src/app
|
24
|
-
- gems:/usr/local/bundle
|
25
|
-
entrypoint: /usr/src/app/dev-entrypoint.sh
|
26
|
-
command: bundle exec rspec
|
27
|
-
networks:
|
28
|
-
- back-tier
|
29
|
-
- front-tier
|
30
|
-
depends_on:
|
31
|
-
- postgres
|
32
|
-
- redis
|
33
|
-
environment:
|
34
|
-
PATH: /usr/src/app/bin:/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
35
|
-
REDIS_URL: redis://redis:6379
|
36
|
-
DATABASE_URL: postgresql://postgres:3x4mpl3@postgres:5433/rails_example_test
|
37
|
-
RAILS_ENV: test
|
38
|
-
RACK_ENV: test
|
39
|
-
|
40
|
-
redis:
|
41
|
-
image: redis:latest
|
42
|
-
ports:
|
43
|
-
# We'll bind our host's port 6379 to redis's port 6379, so we can use
|
44
|
-
# Redis Desktop Manager (or other tools) with it:
|
45
|
-
- 6379:6379
|
46
|
-
volumes:
|
47
|
-
# We'll store the redis data in the 'redis-data' volume we defined:
|
48
|
-
- redis-data:/var/lib/redis
|
49
|
-
command: redis-server --appendonly yes
|
50
|
-
# Make the redis service available only on the "back-tier" network:
|
51
|
-
# NOTE: See networks comment on the postgres service above.
|
52
|
-
networks: [ "back-tier" ]
|
53
|
-
|
54
|
-
|
55
|
-
postgres:
|
56
|
-
image: postgres:latest
|
57
|
-
ports:
|
58
|
-
# We'll bind our host's port 5432 to postgres's port 5432, so we can use
|
59
|
-
# our database IDEs with it:
|
60
|
-
- 5433:5433
|
61
|
-
volumes:
|
62
|
-
# We'll store the postgres data in the 'postgres-data' volume we defined:
|
63
|
-
- postgres-data:/var/lib/postgresql/data
|
64
|
-
networks:
|
65
|
-
# Make the database service available only on the "back-tier" network:
|
66
|
-
# NOTE: Although the service is available only on the "back-tier" network,
|
67
|
-
# the host-to-container port binding we've defined for development
|
68
|
-
# purposes will allow connection from the development host.
|
69
|
-
- back-tier
|
70
|
-
environment:
|
71
|
-
POSTGRES_PASSWORD: 3x4mpl3
|
@@ -1,27 +0,0 @@
|
|
1
|
-
FROM ruby:2.3
|
2
|
-
MAINTAINER Mika Hel <mikael@zoolutions.se>
|
3
|
-
|
4
|
-
# ENV BUILD_PACKAGES bash curl-dev ruby-dev build-base git libc-dev linux-headers
|
5
|
-
# ENV RUBY_PACKAGES ruby ruby-io-console openssl-dev postgresql-dev ruby-bundler libxml2-dev libxslt-dev
|
6
|
-
|
7
|
-
# RUN apk update \
|
8
|
-
# && apk upgrade \
|
9
|
-
# && apk add $BUILD_PACKAGES \
|
10
|
-
# && apk add $RUBY_PACKAGES \
|
11
|
-
# && rm -rf /var/cache/apk/* \
|
12
|
-
# && mkdir -p /usr/src/app \
|
13
|
-
# && bundle config --global jobs 8
|
14
|
-
|
15
|
-
# WORKDIR /usr/src/app
|
16
|
-
|
17
|
-
# COPY Gemfile /usr/src/app/
|
18
|
-
# COPY Gemfile.lock /usr/src/app/
|
19
|
-
|
20
|
-
# ENV BUNDLE_GEMFILE /usr/src/app/Gemfile
|
21
|
-
# ENV BUNDLE_JOBS 8
|
22
|
-
# ENV BUNDLE_RETRY 5
|
23
|
-
# ENV BUNDLE_PATH /usr/local/bundle
|
24
|
-
|
25
|
-
# RUN bundle install --jobs 8 --retry 5
|
26
|
-
|
27
|
-
# COPY . /usr/src/app
|
File without changes
|
File without changes
|
data/rails_example/log/.keep
DELETED
File without changes
|
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
body {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body>
|
58
|
-
<!-- This file lives in public/404.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
body {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body>
|
58
|
-
<!-- This file lives in public/422.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The change you wanted was rejected.</h1>
|
62
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
@@ -1,66 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
body {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body>
|
58
|
-
<!-- This file lives in public/500.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>We're sorry, but something went wrong.</h1>
|
62
|
-
</div>
|
63
|
-
<p>If you are the application owner check the logs for more information.</p>
|
64
|
-
</div>
|
65
|
-
</body>
|
66
|
-
</html>
|
File without changes
|
data/rails_example/simple.ru
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# Easiest way to run Sidekiq::Web.
|
2
|
-
# Run with "bundle exec rackup simple.ru"
|
3
|
-
|
4
|
-
require 'sidekiq'
|
5
|
-
|
6
|
-
# A Web process always runs as client, no need to configure server
|
7
|
-
Sidekiq.configure_client do |config|
|
8
|
-
config.redis = { url: 'redis://localhost:6379/0', size: 1, namespace: 'foo' }
|
9
|
-
end
|
10
|
-
|
11
|
-
require 'sidekiq/web'
|
12
|
-
run Sidekiq::Web
|
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
MOCK_REDIS = MockRedis.new
|
4
|
-
|
5
|
-
describe WorkController, 'with mock redis' do
|
6
|
-
before do
|
7
|
-
MOCK_REDIS.keys.each do |key|
|
8
|
-
MOCK_REDIS.del(key)
|
9
|
-
end
|
10
|
-
|
11
|
-
Sidekiq::Queues.clear_all
|
12
|
-
Sidekiq::Worker.clear_all
|
13
|
-
|
14
|
-
SidekiqUniqueJobs.configure do |config|
|
15
|
-
config.redis_test_mode = :mock
|
16
|
-
end
|
17
|
-
allow(Sidekiq).to receive(:redis).and_yield(MOCK_REDIS)
|
18
|
-
end
|
19
|
-
|
20
|
-
describe 'GET /work/duplicate_simple' do
|
21
|
-
context 'when test mode is fake', sidekiq: :fake do
|
22
|
-
specify do
|
23
|
-
expect { get :duplicate_simple, params: { id: 10 } }
|
24
|
-
.to change { SimpleWorker.jobs.size }
|
25
|
-
.from(0)
|
26
|
-
.to(1)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'when test mode is disabled', sidekiq: :disable do
|
31
|
-
specify do
|
32
|
-
get :duplicate_simple, params: { id: 11 }
|
33
|
-
Sidekiq.redis do |c|
|
34
|
-
expect(c.keys.size).to eq(2)
|
35
|
-
expect(c.llen('queue:default')).to eq(0)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'when test mode is inline', sidekiq: :inline do
|
41
|
-
specify do
|
42
|
-
get :duplicate_simple, params: { id: 12 }
|
43
|
-
Sidekiq.redis do |c|
|
44
|
-
expect(c).to be_a(MockRedis)
|
45
|
-
expect(c.keys.size).to eq(0)
|
46
|
-
expect(c.llen('queue:default')).to eq(0)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe 'GET /work/duplicate_nested' do
|
53
|
-
context 'when test mode is fake', sidekiq: :fake do
|
54
|
-
specify do
|
55
|
-
expect { get :duplicate_nested, params: { id: 20 } }
|
56
|
-
.to change { SpawnSimpleWorker.jobs.size }
|
57
|
-
.from(0)
|
58
|
-
.to(4)
|
59
|
-
|
60
|
-
SpawnSimpleWorker.perform_one
|
61
|
-
SpawnSimpleWorker.perform_one
|
62
|
-
expect(SpawnSimpleWorker.jobs.size).to eq(2)
|
63
|
-
expect(SimpleWorker.jobs.size).to eq(1)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
context 'when test mode is disabled', sidekiq: :disable do
|
68
|
-
specify do
|
69
|
-
get :duplicate_nested, params: { id: 21 }
|
70
|
-
|
71
|
-
Sidekiq.redis do |c|
|
72
|
-
expect(c).to be_a(MockRedis)
|
73
|
-
expect(c.keys.size).to eq(0)
|
74
|
-
expect(c.llen('queue:default')).to eq(0)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
context 'when test mode is inline', sidekiq: :inline do
|
80
|
-
specify do
|
81
|
-
get :duplicate_nested, params: { id: 22 }
|
82
|
-
|
83
|
-
Sidekiq.redis do |c|
|
84
|
-
expect(c).to be_a(MockRedis)
|
85
|
-
expect(c.keys.size).to eq(0)
|
86
|
-
expect(c.llen('queue:default')).to eq(0)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|