File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,19 @@ The `after_fork` hook will be run in the child process and is passed
38
38
the current job. Any changes you make, therefor, will only live as
39
39
long as the job currently being processes.
40
40
41
+ You can also run a hook both before a worker pauses (` before_pause ` ),
42
+ and after it is paused (` after_pause ` ). Each case the block will be
43
+ passed the worker that is pausing or unpausing, respectively:
44
+
45
+ Resque.before_pause do |worker|
46
+ puts "It looks like #{worker} is now paused!"
47
+ end
48
+
49
+
50
+ Resque.after_pause do |worker|
51
+ puts "Whew, back to work for #{worker}!"
52
+ end
53
+
41
54
All worker hooks can also be set using a setter, e.g.
42
55
43
56
Resque.after_fork = proc { puts "called" }
You can’t perform that action at this time.
0 commit comments