| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| |
| |
| |
| | |
[ci skip]
Documentation: update queue_classic info in Active Job adapters list
|
|/ |
|
|\
| |
| | |
Make ActiveJob locale aware
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When `#perform_later` is called the locale isn't stored on the
queue, which results in a locale reset when the job is performed.
An example of the problem:
I18n.locale = 'de'
HelloJob.perform_now # german message, correct
but
I18n.locale = 'de'
HelloJob.perform_later # english message, incorrect
This PR attaches the current I18n.locale to every job during the
serialization process. It is then restored during deserialization
and used to perform the job with the correct locale.
It falls back to the default locale if no serialized locale is
found in order to provide backward compatibility with previously
stored jobs. It is not necessary to clear the queue for the update.
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Provide provider_job_id to qu adapter.
|
| |
| |
| |
| | |
Further work to provide provider_job_id for queue adapters.
|
|/ |
|
|
|
|
| |
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
When a job is added to Sidekiq by ActiveJob, make sure we still can get the
original job_id provider by Sidekiq. We do this by adding the sidekiq jid to
provider_job_id field on the job object.
Partly fixes #18821
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
|
|
|
|
|
| |
When queueing with DelayedJob, get the id of the job instance and report
it back to ActiveJob as provider_job_id.
|
|\
| |
| | |
ActiveJob: Stop using Que's named queues.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
adapters [ci skip]
fix error message
change raise to use rails conventions
fix misspells
|
| | |
|
| |
| |
| |
| |
| |
| | |
Closes #19866
[ci skip]
|
| | |
|
| | |
|
| |
| |
| |
| | |
QueueAdapters table in docs.
|
| | |
|
|/
|
|
|
|
|
| |
Sidekiq logs the name of the job class being performed. Because
ActiveJob wraps the class, this means every job logs as an AJ::JobWrapper
instead of the actual class name.
Will help fix mperham/sidekiq#2248
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This allows different `queue_adapters` to be used in each `ActiveJob`
class heirarchy. Previously, all subclasses used a single global queue
adapter.
|
| |
|
|
|
|
|
|
|
| |
The filter was set on the pseudo-global TestAdapter but not restored to
its original value.
See e818f65770fe115ab1cc7fbacc0e7e94d92af6a4
|
| |
|
|
|
|
|
|
|
|
|
| |
Since `ActiveJob::TestHelper` globally sets
`ActiveJob::Base.queue_adapter` on setup, there is no benefit in
instantiating a new `TestAdapter` per tests. The original rationale was
to allow parallel tests to run without interference, but since they'd
all mutate the global `ActiveJob::Base.queue_adapter`, that was never
realized.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type.
This allows specific jobs to be tested, while preventing others from
being performed unnecessarily.
Example:
def test_hello_job
assert_performed_jobs 1, only: HelloJob do
HelloJob.perform_later('jeremy')
LoggingJob.perform_later
end
end
An array may also be specified, to support testing multiple jobs.
Example:
def test_hello_and_logging_jobs
assert_nothing_raised do
assert_performed_jobs 2, only: [HelloJob, LoggingJob] do
HelloJob.perform_later('jeremy')
LoggingJob.perform_later('stewie')
RescueJob.perform_later('david')
end
end
end
Fixes #18802.
Trim space and document :only option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately, the HashWithIndifferent access approach is insufficient
for our needs. It's perfectly reasonable to want to use keyword
arguments with Active Job, which we will see as a symbol keyed hash. For
Ruby to convert this back to keyword arguments, it must deserialize to a
symbol keyed hash.
There are two primary changes to the serialization behavior. We first
treat a HWIA separately, and mark it as such so we can convert it back
into a HWIA during deserialization.
For normal hashes, we keep a list of all symbol keys, and convert them
back to symbol keys after deserialization.
Fixes #18741.
|
| |
|
| |
|
|
|
|
| |
With the option, assert_enqueued_jobs will check the number of times a specific kind of job is enqueued.
|
|
|
|
|
|
|
| |
Indent the list content by 4 spaces instead of 2 to match the other
changelog files. Also wrap the lines around 80 chars.
Finally update the documentation example with nit-picky things.
|
|\
| |
| | |
Fix spell life cycle on activejob docs [ci skip]
|
| | |
|
| | |
|
|\ \
| | |
| | | |
ActiveJob testing improvements
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
1. The :test adapter wasn't going through a full cycle of
serialize/deserialize when performing jobs. Now it does
2. Regular AJ tests were not run for the :test adapter. Now they are
3. ActiveJob::TestHelper uses assert_valid_keys but doesn’t requires
the file that implements that method. Now it does
|