currentsh 0.3.0 → 0.3.1
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 +4 -4
- data/lib/currentsh/sidekiq.rb +9 -12
- data/lib/currentsh/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: 7727e0736a3df105e925bd84bba64039dd37db5d
|
|
4
|
+
data.tar.gz: dc6881b53831dcd5958ee69d6879b468dd6c9925
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bc02a02774cd334e784797df3e654f4966739cfc74f329c836bc74d6a9000a4c3e04de8630a7a8e871896e6104f8c4ba80c049853804601745dea8cbb9d0ca8
|
|
7
|
+
data.tar.gz: 0dc0563a0ddcc6430e947b6c6044f7292c88cfd33b5263c6fbb8d02e43e55c0a86e01ebb246b08ba6b42c73f0ea77e516598bcee855adef007b2937f8b53c48e
|
data/lib/currentsh/sidekiq.rb
CHANGED
|
@@ -14,8 +14,14 @@ module Currentsh
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
LogOutput.with_context(context) do
|
|
17
|
+
|
|
18
|
+
lc = {
|
|
19
|
+
process: ::Process.pid,
|
|
20
|
+
thread: Thread.current.object_id.to_s(36)
|
|
21
|
+
}.merge(context)
|
|
22
|
+
|
|
17
23
|
begin
|
|
18
|
-
ts = start
|
|
24
|
+
ts = start lc
|
|
19
25
|
|
|
20
26
|
yield
|
|
21
27
|
rescue StandardError => ex
|
|
@@ -23,11 +29,11 @@ module Currentsh
|
|
|
23
29
|
when Interrupt, SystemExit, SignalException
|
|
24
30
|
raise ex
|
|
25
31
|
else
|
|
26
|
-
error
|
|
32
|
+
error lc, ex, ts
|
|
27
33
|
raise ex
|
|
28
34
|
end
|
|
29
35
|
else
|
|
30
|
-
stop
|
|
36
|
+
stop lc, ts
|
|
31
37
|
end
|
|
32
38
|
end
|
|
33
39
|
end
|
|
@@ -36,9 +42,6 @@ module Currentsh
|
|
|
36
42
|
time = Time.now
|
|
37
43
|
|
|
38
44
|
data = {
|
|
39
|
-
time: time,
|
|
40
|
-
process: ::Process.pid,
|
|
41
|
-
thread: Thread.current.object_id.to_s(36),
|
|
42
45
|
event: "start",
|
|
43
46
|
}.merge!(context)
|
|
44
47
|
|
|
@@ -49,9 +52,6 @@ module Currentsh
|
|
|
49
52
|
|
|
50
53
|
def error(context, error, start)
|
|
51
54
|
data = {
|
|
52
|
-
time: Time.now,
|
|
53
|
-
process: ::Process.pid,
|
|
54
|
-
thread: Thread.current.object_id.to_s(36),
|
|
55
55
|
event: "error",
|
|
56
56
|
error: error.to_s,
|
|
57
57
|
elapse: (Time.now - start)
|
|
@@ -62,9 +62,6 @@ module Currentsh
|
|
|
62
62
|
|
|
63
63
|
def stop(context, start)
|
|
64
64
|
data = {
|
|
65
|
-
time: Time.now,
|
|
66
|
-
process: ::Process.pid,
|
|
67
|
-
thread: Thread.current.object_id.to_s(36),
|
|
68
65
|
event: "stop",
|
|
69
66
|
elapse: (Time.now - start)
|
|
70
67
|
}.merge!(context)
|
data/lib/currentsh/version.rb
CHANGED