que-scheduler 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/que/scheduler/scheduler_job.rb +12 -2
- data/lib/que/scheduler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e54bf837ce1acc9f829cdf334cc2cc7cd95d3fd
|
4
|
+
data.tar.gz: 5d0f91e0731cb89afd76d8d59879f896a56821ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee6bbaea0a10b325e0e81c4137fb94ba09eb8697dc59134251bb4794fc5e64381bfab040bc5e9c41c42302cdee763b90c71d96b1df47d612a32a660388812489
|
7
|
+
data.tar.gz: 790f298880c4bbeb5b7b876221a1da6cab6ec061feb350cdb3e879f3148bad08d9450e3996c14ea02d2b97c349401b399419b223c1421d7aea81e223a7137dca
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
que-scheduler
|
2
2
|
================
|
3
3
|
|
4
|
-
[![Build Status](https://travis-ci.org/
|
4
|
+
[![Build Status](https://travis-ci.org/hlascelles/que-scheduler.svg?branch=master)](https://travis-ci.org/hlascelles/que-scheduler)
|
5
5
|
[![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/710d2fc5202f95d76e8a/maintainability)](https://codeclimate.com/github/hlascelles/que-scheduler/maintainability)
|
6
6
|
|
7
7
|
### Description
|
@@ -13,12 +13,22 @@ module Que
|
|
13
13
|
last_time = last_time.nil? ? Time.now : Time.zone.parse(last_time)
|
14
14
|
as_time = Time.now
|
15
15
|
|
16
|
+
Que.log({ message: "que-scheduler last ran at #{last_time}." })
|
17
|
+
|
16
18
|
result =
|
17
19
|
ScheduleParser.parse(SchedulerJob.scheduler_config, as_time, last_time, known_jobs)
|
18
20
|
result.missed_jobs.each do |job_class, args_arrays|
|
19
|
-
args_arrays.each { |args|
|
21
|
+
args_arrays.each { |args|
|
22
|
+
Que.log({ message: "que-scheduler enqueueing #{job_class} with args: #{args}" })
|
23
|
+
job_class.enqueue(*args)
|
24
|
+
}
|
20
25
|
end
|
21
|
-
|
26
|
+
|
27
|
+
SchedulerJob.enqueue(
|
28
|
+
as_time,
|
29
|
+
result.schedule_dictionary,
|
30
|
+
run_at: as_time + result.seconds_until_next_job
|
31
|
+
)
|
22
32
|
destroy
|
23
33
|
end
|
24
34
|
end
|