soar_auditing_provider 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soar_auditing_provider/auditing_worker.rb +14 -16
- data/lib/soar_auditing_provider/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e5afebbca1923373653a142f02a6a7c5dda6d2f
|
4
|
+
data.tar.gz: 1367dbae9df9debc6a777158732b2a41b25baffc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8ee231018f389d0754d23327b9c1c20e78422d100a4b3feacce9443368686de6274bae80db18172744d355195f5d0ca2114d66ae33ad7847c4da6e3285325e3
|
7
|
+
data.tar.gz: a4914177481c905ca9438302cbd230f1dbf6f22845b6267c92de887a4464c8f50038d158111b55284a179f9c204f618d21da013ae3564e58896feb9a39a3f4ee
|
@@ -13,6 +13,7 @@ module SoarAuditingProvider
|
|
13
13
|
def initialize
|
14
14
|
@queue = Queue.new
|
15
15
|
@start_mutex = Mutex.new
|
16
|
+
@queue_mutex = Mutex.new
|
16
17
|
initialize_metrics
|
17
18
|
end
|
18
19
|
|
@@ -26,20 +27,16 @@ module SoarAuditingProvider
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def enqueue(level, data)
|
29
|
-
|
30
|
+
@queue_mutex.synchronize {
|
31
|
+
raise AuditingOverflowError if @queue.size >= @maximum_queue_size
|
30
32
|
@queue.push({:level => level, :data => data})
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
ensure_worker_is_running
|
33
|
+
start
|
34
|
+
}
|
35
35
|
end
|
36
36
|
|
37
|
-
def start
|
37
|
+
def start
|
38
38
|
@start_mutex.synchronize {
|
39
|
-
if not running?
|
40
|
-
super()
|
41
|
-
$stderr.puts("Auditing worker was not running and respawned") if verbose
|
42
|
-
end
|
39
|
+
super if not running?
|
43
40
|
}
|
44
41
|
end
|
45
42
|
|
@@ -64,11 +61,16 @@ module SoarAuditingProvider
|
|
64
61
|
failed_before = true
|
65
62
|
retry
|
66
63
|
end
|
67
|
-
|
64
|
+
|
65
|
+
@queue_mutex.synchronize {
|
66
|
+
return false if not @queue.empty? #indicates to thread worker that we are not done executing since the queue is not empty
|
67
|
+
stop #explicitly stop the thread so that the stop occur automatically along with queue operations.
|
68
|
+
return true #indicates to thread worker that we are done executing since the queue is empty
|
69
|
+
}
|
68
70
|
end
|
69
71
|
|
70
72
|
def flush(timeout = 1)
|
71
|
-
|
73
|
+
start
|
72
74
|
wait_for_worker_to_clear_queue(timeout)
|
73
75
|
fallback_flush_to_stderr if @queue.size > 0
|
74
76
|
end
|
@@ -101,10 +103,6 @@ module SoarAuditingProvider
|
|
101
103
|
$stderr.puts "#{notification}: #{message}"
|
102
104
|
end
|
103
105
|
|
104
|
-
def ensure_worker_is_running
|
105
|
-
start(verbose: true)
|
106
|
-
end
|
107
|
-
|
108
106
|
def ensure_worker_is_stopped
|
109
107
|
attempt_graceful_stop
|
110
108
|
sleep_while_still_running(5)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soar_auditing_provider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernst van Graan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-10-
|
12
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|