cloudtasker 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8721e878a098657f0c3974670df6373c873d1df2fa1042b97d9b37d7a1118299
4
- data.tar.gz: ffd5652b0220a833f603682fdb4392a850b13b185bd7516dd170f5314d1b4af6
3
+ metadata.gz: 92abbab630f4e60c7ae8a6b2e249a5e19d49ad9730788381790463cfda136aea
4
+ data.tar.gz: c71fcf022efd34d3bba1e11341583b18581d1ae93bcd128b769b2e871e5e76f6
5
5
  SHA512:
6
- metadata.gz: f0f98ff0e0062b28be192f8353363a736f5cb315eb14f86f577586de070127642d123617e8e831dea84271cada640ea3b9ec642ea75f3f9a12cd494432b9e178
7
- data.tar.gz: a04500924970efdbc0ceb9364314e0426c92800a4c571b839432de5b9f2faa04e678a67186b0dfd2b32222e8d8606e39ce51b0922ba9687ea827271174dcb23d
6
+ metadata.gz: 4a0f52436da444c75530ceb49ac16ce4c76392383011774accb31418447b6d0b2677e1289cb5768be39bb51b2665b46f347e0496c98c9552bf8c1a82a324f6e1
7
+ data.tar.gz: 5597abc655cef50010bbb38850cc26a5f440404aa8e3d0b645d49fe6bf34f4222d8402e1d61d3e99cf4a0093f7ccd66f561258a3b02595de7a7774cb21cda643
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.6.0](https://github.com/keypup-io/cloudtasker/tree/v0.6.0) (2019-11-25)
4
+
5
+ [Full Changelog](https://github.com/keypup-io/cloudtasker/compare/v0.5.0...v0.6.0)
6
+
3
7
  ## [v0.5.0](https://github.com/keypup-io/cloudtasker/tree/v0.5.0) (2019-11-25)
4
8
 
5
9
  [Full Changelog](https://github.com/keypup-io/cloudtasker/compare/v0.4.0...v0.5.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudtasker (0.6.0)
4
+ cloudtasker (0.7.0)
5
5
  activesupport
6
6
  fugit
7
7
  google-cloud-tasks
data/README.md CHANGED
@@ -293,8 +293,6 @@ end
293
293
 
294
294
  The Cloudtasker server can then be started using:
295
295
  ```bash
296
- cloudtasker
297
- # or
298
296
  bundle exec cloudtasker
299
297
  ```
300
298
 
@@ -9,7 +9,7 @@ The Cloudtasker batch job extension allows to add sub-jobs to regular jobs. This
9
9
  You can enable batch jobs by adding the following to your cloudtasker initializer:
10
10
  ```ruby
11
11
  # The batch job extension is optional and must be explicitly required
12
- require 'cloudtasker/batch_job'
12
+ require 'cloudtasker/batch'
13
13
 
14
14
  Cloudtasker.configure do |config|
15
15
  # Specify your redis url.
@@ -9,7 +9,7 @@ The Cloudtasker cron job extension allows you to register workers to run at fixe
9
9
  You can schedule cron jobs by adding the following to your cloudtasker initializer:
10
10
  ```ruby
11
11
  # The cron job extension is optional and must be explicitly required
12
- require 'cloudtasker/cron_job'
12
+ require 'cloudtasker/cron'
13
13
 
14
14
  Cloudtasker.configure do |config|
15
15
  # Specify your redis url.
@@ -18,18 +18,20 @@ Cloudtasker.configure do |config|
18
18
  end
19
19
 
20
20
  # Specify all your cron jobs below. This will synchronize your list of cron jobs (cron jobs previously created and not listed below will be removed).
21
- Cloudtasker::Cron::Schedule.load_from_hash!(
22
- # Run job every minute
23
- some_schedule_name: {
24
- worker: 'SomeCronWorker',
25
- cron: '* * * * *'
26
- },
27
- # Run job every hour on the fifteenth minute
28
- other_cron_schedule: {
29
- worker: 'OtherCronWorker',
30
- cron: '15 * * * *'
31
- }
32
- )
21
+ unless Rails.env.test?
22
+ Cloudtasker::Cron::Schedule.load_from_hash!(
23
+ # Run job every minute
24
+ some_schedule_name: {
25
+ worker: 'SomeCronWorker',
26
+ cron: '* * * * *'
27
+ },
28
+ # Run job every hour on the fifteenth minute
29
+ other_cron_schedule: {
30
+ worker: 'OtherCronWorker',
31
+ cron: '15 * * * *'
32
+ }
33
+ )
34
+ end
33
35
  ```
34
36
 
35
37
  ## Using a configuration file
@@ -56,7 +58,7 @@ Then register the jobs inside your Cloudtasker initializer this way:
56
58
  # ... Cloudtasker configuration ...
57
59
 
58
60
  schedule_file = 'config/cloudtasker_cron.yml'
59
- if File.exist?(schedule_file)
61
+ if File.exist?(schedule_file) && !Rails.env.test?
60
62
  Cloudtasker::Cron::Schedule.load_from_hash!(YAML.load_file(schedule_file))
61
63
  end
62
64
  ```
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cloudtasker
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.0'
5
5
  end
@@ -32,8 +32,9 @@ module Cloudtasker
32
32
  # @return [Cloudtasker::Worker, nil] The instantiated worker.
33
33
  #
34
34
  def self.from_hash(hash)
35
- # Symbolize payload keys
35
+ # Symbolize metadata keys and stringify job arguments
36
36
  payload = JSON.parse(hash.to_json, symbolize_names: true)
37
+ payload[:job_args] = JSON.parse(hash[:job_args].to_json)
37
38
 
38
39
  # Extract worker parameters
39
40
  klass_name = payload&.dig(:worker)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudtasker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Lachaume