async-job-adapter-active_job 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 180cb5494a48806a8fed0606cab10241c1de1ffd3bd5fb67f401362e5a9a6428
4
- data.tar.gz: cbc2e1c64b6e6fedbeaab13377725741dc757e2643419181e53440c308d07243
3
+ metadata.gz: 5d1cb1e42e12edd769d1cabbd69b95db8332178ec952275e2e587fb8d4679c29
4
+ data.tar.gz: 4c560b3d759812bcef27293441528077b4dfc4278399519d802d5c097f8ba710
5
5
  SHA512:
6
- metadata.gz: 33f8aee5982c62455adf93e4128bfc6c02b5b94313aa2b48fa47d3bccbd7293f1eb1f76ea190671a5eea28aa949b71a98c1d56fab5a5b00b74e2150a642d7cf7
7
- data.tar.gz: 3775afc93c99661870ecfce968ac0e02133de75dcfc445d0219caf39244755b1dc67c0b579d629622816bd0c96c1b85b5dfe528690063270c0278bc7599a8cde
6
+ metadata.gz: 486fa0105ecf07506ae2c807e6c1d7f013d2d4bcd11df00c703143a8379cd6abc0a46b8532ef24abe960cd598aeb8ecdd5fb63e397a516bbbca199eb5d016428
7
+ data.tar.gz: eae87108c3e46b892f086cf39f1359888e3938c8127e9e39f716bf2c05bb89bb6f284844f643a004122845150861467153892c98984d43677393db1964cfdab5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -17,8 +17,14 @@ module Async
17
17
 
18
18
  # Execute the given job.
19
19
  def call(job)
20
- # Console.debug(self, "Executing job...", id: job["job_id"])
21
- ::ActiveJob::Base.execute(job)
20
+ Console.debug(self, "Executing job...", job: job)
21
+ begin
22
+ ::ActiveJob::Base.execute(job)
23
+ rescue => error
24
+ # Error handling is done by the job itself.
25
+ # Ignore the error here, as ActiveJob has already logged unhandled errors.
26
+ # Console::Event::Failure.for(error).emit(self, "Failed to execute job!", job: job)
27
+ end
22
28
 
23
29
  @delegate&.call(job)
24
30
  end
@@ -15,14 +15,14 @@ module Async
15
15
 
16
16
  # Enqueue a job for processing.
17
17
  def enqueue(job)
18
- # Console.debug(self, "Enqueueing job...", id: job.job_id)
18
+ Console.debug(self, "Enqueueing job...", id: job.job_id)
19
19
  @delegate.call(serialize(job))
20
20
  end
21
21
 
22
22
  # Enqueue a job for processing at a specific time.
23
23
  def enqueue_at(job, timestamp)
24
24
  # We assume the given timestamp is the same as `job.scheduled_at` which is true in every case we've seen so far.
25
- # Console.debug(self, "Scheduling job...", id: job.job_id, scheduled_at: job.scheduled_at)
25
+ Console.debug(self, "Scheduling job...", id: job.job_id, scheduled_at: job.scheduled_at)
26
26
  @delegate.call(serialize(job))
27
27
  end
28
28
 
@@ -39,6 +39,8 @@ module Async
39
39
  # @parameter aliases [Array(String)] The aliases for the backend.
40
40
  # @parameter block [Proc] The block that defines the backend.
41
41
  def define_queue(name, *aliases, &block)
42
+ name = name.to_s
43
+
42
44
  @definitions[name] = block
43
45
 
44
46
  if aliases.any?
@@ -49,6 +51,8 @@ module Async
49
51
  # Define an alias for a queue.
50
52
  def alias_queue(name, *aliases)
51
53
  aliases.each do |alias_name|
54
+ alias_name = alias_name.to_s
55
+
52
56
  @aliases[alias_name] = name
53
57
  end
54
58
  end
@@ -7,7 +7,7 @@ module Async
7
7
  module Job
8
8
  module Adapter
9
9
  module ActiveJob
10
- VERSION = "0.11.0"
10
+ VERSION = "0.12.1"
11
11
  end
12
12
  end
13
13
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-job-adapter-active_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,7 +37,7 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2024-08-08 00:00:00.000000000 Z
40
+ date: 2024-08-09 00:00:00.000000000 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: async-job
metadata.gz.sig CHANGED
Binary file