epi 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epi/job.rb +0 -10
- data/lib/epi/job_description.rb +1 -9
- data/lib/epi/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: 57f124b51a4bab5b1b21b5ef967ae58a5fdf5dbb
|
4
|
+
data.tar.gz: 484a9176fe08813ebfba822f7d238209dbd19399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d367c6232d86ad39672c2bb9b80bd82646c8b54dda58774f06a4b6f0f15415b2aa3ee06c63493573a6eb47c3b29b2df2db72927e08da972d63238b69f98f5b3
|
7
|
+
data.tar.gz: 63265713751c3e1095d4bc1438ef730c0ec62ea98e14f5d9bb623908a58d6de50ef723d1ff2fa95828b670b3f9fef13a65c7dc4b452a8283716e78a1b25f8dd7
|
data/lib/epi/job.rb
CHANGED
@@ -45,14 +45,6 @@ module Epi
|
|
45
45
|
@dying_pids ||= {}
|
46
46
|
end
|
47
47
|
|
48
|
-
# Get the data key for the PID file of the given process ID or PID
|
49
|
-
# @param [String|Fixnum] proc_id Example: `'1a2b3c4d'` or `1234`
|
50
|
-
# @return [String|NilClass] Example: `pids/job_id/1ab3c4d.pid`, or `nil` if not found
|
51
|
-
def pid_key(proc_id)
|
52
|
-
proc_id = pids.key(proc_id) if Fixnum === proc_id
|
53
|
-
proc_id && job_description.pid_key(proc_id)
|
54
|
-
end
|
55
|
-
|
56
48
|
# Stops processes that shouldn't run, starts process that should run, and
|
57
49
|
# fires event handlers
|
58
50
|
def sync!
|
@@ -137,7 +129,6 @@ module Epi
|
|
137
129
|
def start_one
|
138
130
|
proc_id, pid = job_description.launch
|
139
131
|
pids[proc_id] = pid
|
140
|
-
Data.write pid_key(proc_id), pid
|
141
132
|
Jobs.by_pid[pid] = self
|
142
133
|
end
|
143
134
|
|
@@ -155,7 +146,6 @@ module Epi
|
|
155
146
|
end
|
156
147
|
done = proc do
|
157
148
|
dying_pids.delete proc_id
|
158
|
-
Data.write pid_key(proc_id), nil
|
159
149
|
Jobs.by_pid.delete pid
|
160
150
|
callback.call if callback
|
161
151
|
end
|
data/lib/epi/job_description.rb
CHANGED
@@ -69,7 +69,7 @@ module Epi
|
|
69
69
|
opts = {
|
70
70
|
cwd: directory,
|
71
71
|
user: user,
|
72
|
-
env:
|
72
|
+
env: environment || {},
|
73
73
|
stdout: stdout,
|
74
74
|
stderr: stderr
|
75
75
|
}
|
@@ -87,14 +87,6 @@ module Epi
|
|
87
87
|
@triggers << [trigger_name, args, handler]
|
88
88
|
end
|
89
89
|
|
90
|
-
def pid_key(proc_id)
|
91
|
-
"pids/#{id}/#{proc_id}.pid"
|
92
|
-
end
|
93
|
-
|
94
|
-
def pid_path(proc_id)
|
95
|
-
Data.home + pid_key(proc_id)
|
96
|
-
end
|
97
|
-
|
98
90
|
private
|
99
91
|
|
100
92
|
def generate_id
|
data/lib/epi/version.rb
CHANGED