rufus-scheduler 3.8.1 → 3.8.2

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: fec88a5f600474172a07002ec7a17c2b35cd9aeffff3e2cfe9865e49e0c9a6d7
4
- data.tar.gz: ca607aef24a501fd1a23370e230c6481fe8624c6111c79b11f7f59fc5edc5884
3
+ metadata.gz: 9fbe0f73068129b96196031b141f480f830e3110e35d3c5eaa2206530b1ae536
4
+ data.tar.gz: bec310a43820928b8d342b5b3602edf8cb27aaca8995e0a18073d70dfd3839f8
5
5
  SHA512:
6
- metadata.gz: 0e2535642cb251105341e3d70998500f86370d41b13a6841698e15bc729d5d94ec420cfa4dc4549794ff53b82e442ae61962a61f10751a10c303f21a991d4cfc
7
- data.tar.gz: bdfe0713a8b5bbec83403dbc1232f5bd310579707fd7b838a224367bc4cdd34752defc47f9cc1bb0686267c3a4b49114490866d6b8dcde22ce6ec3c52479ea90
6
+ metadata.gz: 3e8edfd4df2ddbb0f8026ffa13fff69f9f4bd045da1638fe5ac38610992e0f7d173b20a27ad1833760d6fee62d41b5b160978e107dbc55a1b9d07dfaa62444ad
7
+ data.tar.gz: 412bb7e80546c5cd13bf8875f928ce6920a9e62774d296db83935adbfee56069cbb2729bb4640962351297cd55b8b5cfb92facfec38e7cb92b3ef9f7446c7283
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ### rufus-scheduler 3.8.2 - released 2022-07-12
6
+
7
+ * Prevent error in shutdown when @thread is current Thread, gh-337
8
+ * Rescue errors on the scheduling thread, gh-335
9
+
10
+
5
11
  ### rufus-scheduler 3.8.1 - released 2022-01-11
6
12
 
7
13
  * Suppress warning about @resume_discard_past
data/CREDITS.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  ## Contributors
6
6
 
7
+ * Bence Monus https://github.com/cromega gh-337 on_error and friends
8
+ * Talia Wong https://github.com/blowfishpro gh-335 on_error and friends
9
+ * Konstantin https://github.com/fa11enangel gh-334 nodejitsu link
10
+ * Olle Jonsson https://github.com/olleolleolle gh-333
7
11
  * Sol Ackerman https://github.com/solarckerman gh-332
8
12
  * John Bachir https://github.com/jjb gh-310 gh-327
9
13
  * Daniel Berger https://github.com/djberg96 gh-300
data/README.md CHANGED
@@ -133,7 +133,7 @@ Yes, issues can be reported in [rufus-scheduler issues](https://github.com/jmett
133
133
  ### faq
134
134
 
135
135
  * [It doesn't work...](https://www.chiark.greenend.org.uk/~sgtatham/bugs.html)
136
- * [I want a refund](https://blog.nodejitsu.com/getting-refunds-on-open-source-projects)
136
+ * [I want a refund](https://web.archive.org/web/20160425034214/http://blog.nodejitsu.com/getting-refunds-on-open-source-projects/)
137
137
  * [Passenger and rufus-scheduler](https://stackoverflow.com/questions/18108719/debugging-rufus-scheduler/18156180#18156180)
138
138
  * [Passenger and rufus-scheduler (2)](https://stackoverflow.com/questions/21861387/rufus-cron-job-not-working-in-apache-passenger#answer-21868555)
139
139
  * [Passenger in-depth spawn methods](https://www.phusionpassenger.com/library/indepth/ruby/spawn_methods/)
@@ -860,7 +860,11 @@ require 'rufus-scheduler'
860
860
  s = Rufus::Scheduler.new
861
861
 
862
862
  def s.on_error(job, err)
863
- p [ 'error in scheduled job', job.class, job.original, err.message ]
863
+ if job
864
+ p [ 'error in scheduled job', job.class, job.original, err.message ]
865
+ else
866
+ p [ 'error while scheduling', err.message ]
867
+ end
864
868
  rescue
865
869
  p $!
866
870
  end
@@ -9,7 +9,7 @@ module Rufus; end
9
9
 
10
10
  class Rufus::Scheduler
11
11
 
12
- VERSION = '3.8.1'
12
+ VERSION = '3.8.2'
13
13
 
14
14
  EoTime = ::EtOrbi::EoTime
15
15
 
@@ -443,10 +443,14 @@ class Rufus::Scheduler
443
443
  ms = {}; mutexes.each { |k, v| ms[k] = v.locked? }
444
444
 
445
445
  stderr.puts("{ #{pre} rufus-scheduler intercepted an error:")
446
- stderr.puts(" #{pre} job:")
447
- stderr.puts(" #{pre} #{job.class} #{job.original.inspect} #{job.opts.inspect}")
448
- stderr.puts(" #{pre} #{job.source_location.inspect}")
449
- # TODO: eventually use a Job#detail or something like that
446
+ if job
447
+ stderr.puts(" #{pre} job:")
448
+ stderr.puts(" #{pre} #{job.class} #{job.original.inspect} #{job.opts.inspect}")
449
+ stderr.puts(" #{pre} #{job.source_location.inspect}")
450
+ # TODO: eventually use a Job#detail or something like that
451
+ else
452
+ stderr.puts(" #{pre} job: (error did not occur in a job)")
453
+ end
450
454
  stderr.puts(" #{pre} error:")
451
455
  stderr.puts(" #{pre} #{err.object_id}")
452
456
  stderr.puts(" #{pre} #{err.class}")
@@ -530,7 +534,7 @@ class Rufus::Scheduler
530
534
 
531
535
  unlock
532
536
 
533
- @thread.join
537
+ @thread.join unless @thread == Thread.current
534
538
  end
535
539
  alias stop shutdown
536
540
 
@@ -630,12 +634,20 @@ class Rufus::Scheduler
630
634
  Thread.new do
631
635
 
632
636
  while @started_at do
637
+ begin
638
+
639
+ unschedule_jobs
640
+ trigger_jobs unless @paused_at
641
+ timeout_jobs
633
642
 
634
- unschedule_jobs
635
- trigger_jobs unless @paused_at
636
- timeout_jobs
643
+ sleep(@frequency)
637
644
 
638
- sleep(@frequency)
645
+ rescue => err
646
+ #
647
+ # for `blocking: true` jobs mostly
648
+ #
649
+ on_error(nil, err)
650
+ end
639
651
  end
640
652
 
641
653
  rejoin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.1
4
+ version: 3.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fugit