aboutsummaryrefslogtreecommitdiffstats
path: root/activejob
Commit message (Collapse)AuthorAgeFilesLines
* Consolidate `queue_adapter=` and `interpret_adapter`Ryuta Kamizono2018-01-051-18/+12
| | | | | Since #25037, `queue_adapter=` simply delegates to `interpret_adapter` only.
* Bump license years for 2018Yoshiyuki Hirano2017-12-312-2/+2
|
* Explicitly require `sidekiq/cli`yuuji.yaginuma2017-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Currently, sidekiq integration test + Ruby 2.5.0-rc1 show exception as follows. ``` #<Thread:0x000000000670bec0@/home/travis/build/rails/rails/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.0.5/lib/sidekiq/util.rb:23 run> terminated with exception (report_on_exception is true): /home/travis/build/rails/rails/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.1.7/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `block in load_missing_constant': uninitialized constant Sidekiq::CLI (NameError) from /home/travis/build/rails/rails/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.1.7/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache' from /home/travis/build/rails/rails/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.1.7/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `rescue in load_missing_constant' from /home/travis/build/rails/rails/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.1.7/lib/bootsnap/load_path_cache/core_ext/active_support.rb:42:in `load_missing_constant' from /home/travis/build/rails/rails/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.0.5/lib/sidekiq/launcher.rb:65:in `heartbeat' from /home/travis/build/rails/rails/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.0.5/lib/sidekiq/launcher.rb:123:in `start_heartbeat' ``` https://travis-ci.org/rails/rails/jobs/317187279#L2152 The reason for this is that `Sidekiq::CLI` has not been loaded. Sidekiq integration test launches a Sidekiq instance within another Ruby process. In such a case, need to require 'sidekiq/cli' in that launch code. Ref: https://github.com/mperham/sidekiq/pull/3692#issuecomment-352032251
* Suppress `warning: BigDecimal.new is deprecated`Yasuo Honda2017-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | `BigDecimal.new` has been deprecated in BigDecimal 1.3.3 which will be a default for Ruby 2.5. Refer https://github.com/ruby/bigdecimal/commit/533737338db915b00dc7168c3602e4b462b23503 * This commit has been made as follows: ``` cd rails git grep -l BigDecimal.new | grep -v guides/source/5_0_release_notes.md | grep -v activesupport/test/xml_mini_test.rb | xargs sed -i -e "s/BigDecimal.new/BigDecimal/g" ``` - `activesupport/test/xml_mini_test.rb` Editmanually to remove `.new` and `::` - guides/source/5_0_release_notes.md This is a Rails 5.0 release notes.
* Enable `Layout/LeadingCommentSpace` to not allow cosmetic changes in the futureRyuta Kamizono2017-12-142-2/+2
| | | | Follow up of #31432.
* [ci skip] Add a space to comment in SidekiqAdapterYoshiyuki Hirano2017-12-141-1/+1
| | | | | * I think it's better to have a leading space after the `#` denoting the start of the comment.
* Fix example code in ActiveJob::Core [ci skip]Yoshiyuki Hirano2017-12-051-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) It seems that it raise error on example code in `ActiveJob::Core`. Before: ```ruby class DeliverWebhookJob < ActiveJob::Base def serialize super.merge('attempt_number' => (@attempt_number || 0) + 1) end def deserialize(job_data) super @attempt_number = job_data['attempt_number'] end rescue_from(Timeout::Error) do |exception| raise exception if @attempt_number > 5 retry_job(wait: 10) end def perform raise Timeout::Error end end ``` Then it run `DeliverWebhookJob.perform_now` in `rails console`. And raise error: NoMethodError: undefined method `>' for nil:NilClass from /app/jobs/deliver_webhook_job.rb:12:in `block in <class:DeliverWebhookJob>' So I thought it's necessary to fix it. After: ```ruby class DeliverWebhookJob < ActiveJob::Base attr_writer :attempt_number def attempt_number @attempt_number ||= 0 end def serialize super.merge('attempt_number' => attempt_number + 1) end def deserialize(job_data) super self.attempt_number = job_data['attempt_number'] end rescue_from(Timeout::Error) do |exception| raise exception if attempt_number > 5 retry_job(wait: 10) end def perform raise Timeout::Error end end ``` Then it run `DeliverWebhookJob.perform_now` in `rails console`. And it does'nt raise error NoMethodError. 2) Use `Timeout::Error` instead of `TimeoutError` (`TimeoutError` is deprecated).
* Preparing for 5.2.0.beta2 releaseRafael Mendonça França2017-11-282-1/+6
|
* Fix typos and add a few suggestionsFatos Morina2017-11-281-2/+2
|
* Preparing for 5.2.0.beta1 releaseRafael Mendonça França2017-11-272-1/+3
|
* Improve DelayedJob wrapper loggingJacek Lachowski2017-11-242-0/+11
| | | | | | | | ActiveJob wraps every adapter into its own class, that is later passed into DelayedJob which is responsible for displaying all the logs. This change improves the logging so we can easily trace executed jobs and see meaningful information in the logs.
* Use .tt extension to all the template filesRafael Mendonça França2017-11-132-0/+0
| | | | | | | | Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878.
* Make sidekiq and resque integration tests work in CIyuuji.yaginuma2017-11-132-9/+1
| | | | | | | | | | Since 8f2490b, the integration test of sidekiq and resque is not working in CI. https://travis-ci.org/rails/rails/jobs/301276197#L2055 https://travis-ci.org/rails/rails/jobs/301276197#L2061 Because 8f2490b removed password from `redis-server`. So must also remove passwords from these tests.
* Return a non zero code when can not connect to redis in CIyuuji.yaginuma2017-11-132-2/+4
|
* `rails new` runs `rails active_storage:install`bogdanvlviv2017-11-062-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omit `rails activestorage:install` for jdbcmysql, jdbc and shebang tests AppGeneratorTest#test_config_jdbcmysql_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/mysql_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_config_jdbc_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/jdbc_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_shebang_is_added_to_rails_file /home/ubuntu/.rbenv/versions/2.4.1/bin/ruby: no Ruby script found in input (LoadError) Prevent PendingMigrationError in tests * Run `bin/rails db:migrate RAILS_ENV=test` in test_cases before start tests to prevent PendingMigrationError * FileUtils.rm_r("db/migrate") * --skip-active-storage Fix failed tests in `railties/test/railties/engine_test.rb` Related to #30111 Imporve `SharedGeneratorTests#test_default_frameworks_are_required_when_others_are_removed` - Explicitly skip active_storage - Ensure that skipped frameworks are commented - Ensure that default frameworks are not commented Fix error `Errno::ENOSPC: No space left on device - sendfile` Since `rails new` runs `rails active_storage:install` that boots an app. Since adding Bootsnap 0312a5c67e35b960e33677b5358c539f1047e4e1 during booting an app, it creates the cache: 264K tmp/cache/bootsnap-load-path-cache 27M tmp/cache/bootsnap-compile-cache * teardown_app must remove app
* removed unnecessary returnsShuhei Kitagawa2017-10-281-1/+1
|
* Merge pull request #30955 from prathamesh-sonpatki/rm-changelog-entryRafael França2017-10-231-7/+0
|\ | | | | Remove CHANGELOG entry for the change that was backported to 5-1-stable [ci skip]
| * Remove CHANGELOT entry for the change that was backported to 5-1-stable [ci ↵Prathamesh Sonpatki2017-10-231-7/+0
| | | | | | | | | | | | | | | | skip] - It was backported in https://github.com/rails/rails/commit/0eae8dd4b859c109919e5da0d6e74ffc6dc8a258 and is present in Rails 5.1.3
* | [Active Job] require_relative => requireAkira Matsuda2017-10-214-13/+13
|/ | | | This basically reverts fef234f1f0a238c2277459652861144ae89501ff
* Merge pull request #30750 from k2nr/fix-active-jobRyuta Kamizono2017-10-133-3/+3
|\ | | | | Yield with an error instance instead of error class
| * Test exception message to ensure an exception instance is yieldedKazunori Kajihiro2017-10-132-2/+2
| |
| * Yield with an error instance instead of error classKazunori Kajihiro2017-09-291-1/+1
| |
* | redis-rb 4.0 supportJeremy Daer2017-10-082-7/+8
|/ | | | | | | | * Use `gem 'redis', '~> 4.0'` for new app Gemfiles * Loosen Action Cable redis-rb dep to `>= 3.3, < 5` * Bump redis-namespace for looser Redis version dep * Avoid using the underlying `redis.client` directly * Use `Redis.new` instead of `Redis.connect`
* Update activejob doc [ci skip]Yoshiyuki Hirano2017-08-301-1/+1
|
* Update MIT licenses link [ci skip]Yoshiyuki Hirano2017-08-221-1/+1
|
* Use ssl in guide and comment [ci skip]Yoshiyuki Hirano2017-08-191-1/+1
|
* Use `ActiveJob::Base.queue_adapter_name` to get adapter nameyuuji.yaginuma2017-08-171-3/+1
| | | | Since 673606a, it holds adapter name.
* Wait for the Delayed Job worker thread to finishMatthew Draper2017-08-131-0/+1
|
* Use File::NULL instead of "/dev/null"Kazuhiro NISHIYAMA2017-07-311-1/+1
|
* Use `ArgumentError` instead of own error classyuuji.yaginuma2017-07-202-19/+18
| | | | | If the argument is invalid, I think that it is more intuitive to use `ArgumentError` than its own error class.
* Fix `warning: circular argument reference`yuuji.yaginuma2017-07-191-2/+2
| | | | | | | | | This fixes the following warnings: ``` rails/activejob/lib/active_job/test_helper.rb:119: warning: circular argument reference - except rails/activejob/lib/active_job/test_helper.rb:166: warning: circular argument reference - except ```
* Add `except` option for ActiveJob::TestHelper methodsposthumanism2017-07-183-15/+440
|
* [Active Job] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-11100-0/+100
|
* Make sidekiq and resque integration tests work in CIyuuji.yaginuma2017-07-102-1/+9
| | | | | | | | | Since f55ecc6, the integration test of sidekiq and resque is not working in CI. https://travis-ci.org/rails/rails/jobs/251783876 Because f55ecc6 required a password to access redis. Therefore, handling by passing passwords when connecting to redis.
* Use frozen-string-literal in ActiveJobKir Shatrov2017-07-09101-0/+101
|
* [Active Job] require => require_relativeAkira Matsuda2017-07-014-13/+13
|
* Merge pull request #29588 from greysteil/add-gemspec-linksRafael França2017-06-281-0/+5
|\ | | | | Add source code and changelog links to gemspecs
| * Add source code and changelog links to gemspecsGrey Baker2017-06-281-0/+5
| |
* | ActiveJob::Core#serialize stores provider_job_id (fixes #26581).utilum2017-06-272-0/+9
|/
* Remove needless gitignoreyuuji.yaginuma2017-06-261-1/+0
| | | | | | | | | The dummy application is created under the tmp directory. Nothing is created in the `test/dummy` directory. https://github.com/rails/rails/blob/40bdbce191ad90dfea43dad51fac5c4726b89392/activejob/test/support/integration/helper.rb#L9 I guess that this comment makes it unnecessary. https://github.com/rails/rails/pull/16541#r16986711
* Use `require_relative` instead of `require` with full pathbogdanvlviv2017-06-141-1/+1
|
* Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-034-6/+5
|
* Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-292-8/+3
| | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* Bring back delayed_job to test listyuuji.yaginuma2017-05-281-2/+1
| | | | | `delayed_job_active_record` 4.1.2 supports Rails 5.1. Ref: https://github.com/collectiveidea/delayed_job_active_record/pull/138
* Removed string inquiry.Mohit Natoo2017-05-262-6/+6
| | | | | | fixed indentation. rebased with master.
* Provides friendlier way to access queue adapters of a job.Mohit Natoo2017-05-262-4/+22
| | | | - removed predicate method. Used only reader.
* Define path with __dir__bogdanvlviv2017-05-236-8/+7
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* Improving docs for callbacks execution order [ci skip]dixpac2017-05-211-1/+3
| | | | | When define callbacks latest definition on the same callback/method overwrites previous ones.
* Cleanup CHANGELOGs [ci skip]Ryuta Kamizono2017-04-301-0/+1
| | | | | | * Remove trailing spaces. * Add backticks around method and command. * Fix indentation.
* Add missing requireyuuji.yaginuma2017-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this, unit test fails. ``` bundle exec ruby -w -Ilib:lib:test test/cases/logging_test.rb Using inline Run options: --seed 41246 # Running: SE......S.... Finished in 0.052938s, 245.5696 runs/s, 831.1585 assertions/s. 1) Error: LoggingTest#test_job_error_logging: NameError: uninitialized constant LoggingTest::RescueJob test/cases/logging_test.rb:130:in `rescue in test_job_error_logging' test/cases/logging_test.rb:129:in `test_job_error_logging' 13 runs, 44 assertions, 0 failures, 1 errors, 2 skips You have skipped tests. Run with --verbose for details. ```