que-scheduler 0.10.1 → 1.0.0

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
  SHA1:
3
- metadata.gz: 3ac42dcccc27269cd2422b34c0289a65465e1525
4
- data.tar.gz: b85f258df6a12f9b21eae3da99c899c7cc1d0003
3
+ metadata.gz: a243842a2035934a0aa1ee9d28f7620a376491b5
4
+ data.tar.gz: 43cc12d4246e4f74d32f17497fbe43957bc7a7af
5
5
  SHA512:
6
- metadata.gz: 05a947e009768f38ff16b41ed9fa4b1a3c30255cdba0532a6b4e614ce1fca56f642b0dc4cdfb74ee3a3b504382b3d2486e244f9fc41c444cd2ce8b4899c01813
7
- data.tar.gz: 69d0447fac46a6e625d357c018874e1d0eedf61d221b12d5ec3299e3ff4ffd476a14f96212fc451b885f784b5d66cc20fb481fcc666879e7ce67906c4f4cddc7
6
+ metadata.gz: 8f8398000dcd8cf65c1dff98928752fb58e9b548f05b6ea66eb3f2714fe7d58706b57d489a6719b944e1ec48b722c6fed73678e46e957c212ebef5b49b2e7a4c
7
+ data.tar.gz: baff4c34fce9a3bd4649e32490bc47a7b409d22871f8e0f57fe02432657fad0861e89650cc153deae3d1b39304d6bc66cae1e645618db170e2903595de214a38
data/README.md CHANGED
@@ -76,8 +76,8 @@ all_args_job:
76
76
  # Ensure you never miss a job, even after downtime
77
77
  DailyBatchReport:
78
78
  cron: "0 3 * * *"
79
- # This job will be run every day, and if workers are offline for several days, then the backlog
80
- # will all be scheduled when they are restored, each with that events timestamp as the first arg.
79
+ # This job will be run every day. If workers are offline for several days, then the backlog
80
+ # will all be scheduled when they are restored, each with that event's timestamp as the first arg.
81
81
  schedule_type: every_event
82
82
  ```
83
83
 
@@ -90,7 +90,7 @@ A job can have a `schedule_type` assigned to it. Valid values are:
90
90
  how ordinary cron works.
91
91
  1. `every_event` - This job will always be scheduled with an ISO8601 time as the first argument.
92
92
  If multiple cron times go by during an extended period of downtime, then a job will be scheduled
93
- for every one missed. This schedule_type should be used for daily batch jobs that need to know
93
+ for every one missed. This `schedule_type` should be used for daily batch jobs that need to know
94
94
  which day they are running a batch for.
95
95
 
96
96
  ## Environment Variables
@@ -20,22 +20,11 @@ module Que
20
20
  args: v['args'],
21
21
  priority: v['priority'],
22
22
  cron: v['cron'],
23
- schedule_type: schedule_type(v)
23
+ schedule_type: v['schedule_type'] || DefinedJob::SCHEDULE_TYPE_DEFAULT
24
24
  }.compact
25
25
  )
26
26
  end
27
27
  end
28
-
29
- private
30
-
31
- # Migrate legacy config that used the `unmissable` config key.
32
- def schedule_type(v)
33
- if v['unmissable']
34
- DefinedJob::SCHEDULE_TYPE_EVERY_EVENT
35
- else
36
- v['schedule_type'] || DefinedJob::SCHEDULE_TYPE_DEFAULT
37
- end
38
- end
39
28
  end
40
29
  end
41
30
  end
@@ -13,10 +13,7 @@ module Que
13
13
  # Highest possible priority.
14
14
  @priority = 0
15
15
 
16
- def run(options = nil, oldarg = nil)
17
- # Early versions took separate args. We now just pass in a hash.
18
- options = { last_run_time: options, job_dictionary: oldarg } if oldarg.present?
19
-
16
+ def run(options = nil)
20
17
  ::ActiveRecord::Base.transaction do
21
18
  assert_one_scheduler_job
22
19
  scheduler_job_args = SchedulerJobArgs.prepare_scheduler_job_args(options)
@@ -1,5 +1,5 @@
1
1
  module Que
2
2
  module Scheduler
3
- VERSION = '0.10.1'.freeze
3
+ VERSION = '1.0.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: que-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Lascelles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-03 00:00:00.000000000 Z
11
+ date: 2017-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord