philotic 0.1.2 → 0.1.3
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/examples/publishing/publish.rb +1 -2
- data/lib/philotic/publisher.rb +4 -2
- data/lib/philotic/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: 39317c5b0270166a99673c49acea5ba95e6ec879
|
4
|
+
data.tar.gz: fd88d9409ae49657f4bfaab67b4ac76663900c31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d82f2ffdcc8f1f885ae3bd4919086d274dcde8dfc3c60e0d9fec9ea6e9f75bce9312b862812b130fce9cd3581d1886a6233f3b594b84bbf3c340c55ac8c014
|
7
|
+
data.tar.gz: d42cb0239b668e5a737f575fcb551d149f2bc2f6d2654158959b7377c226428e01e8b9f81c8b1425a6a54e347c16ddba9da022062edd095f8cf445770edb9820
|
@@ -5,9 +5,8 @@ $stdout.sync = true
|
|
5
5
|
require 'philotic'
|
6
6
|
require 'philotic/dummy_event'
|
7
7
|
|
8
|
-
Philotic.logger = Logger
|
8
|
+
Philotic.logger.level = Logger::WARN
|
9
9
|
|
10
|
-
Philotic::Connection.connect!
|
11
10
|
@event = Philotic::DummyEvent.new
|
12
11
|
|
13
12
|
@event.philotic_firehose = true
|
data/lib/philotic/publisher.rb
CHANGED
@@ -16,6 +16,10 @@ module Philotic
|
|
16
16
|
|
17
17
|
private
|
18
18
|
def _publish(payload, message_metadata = {})
|
19
|
+
if config.disable_publish
|
20
|
+
Philotic.log_event_published(:warn, message_metadata, payload, 'attempted to publish a message when publishing is disabled.')
|
21
|
+
return false
|
22
|
+
end
|
19
23
|
Philotic.connect!
|
20
24
|
unless Philotic::Connection.connected?
|
21
25
|
Philotic.log_event_published(:error, message_metadata, payload, 'unable to publish event, not connected to RabbitMQ')
|
@@ -25,8 +29,6 @@ module Philotic
|
|
25
29
|
|
26
30
|
payload = normalize_payload_times(payload)
|
27
31
|
|
28
|
-
return if config.disable_publish
|
29
|
-
|
30
32
|
Philotic::Connection.exchange.publish(payload.to_json, message_metadata)
|
31
33
|
Philotic.log_event_published(:debug, message_metadata, payload, 'published event')
|
32
34
|
end
|
data/lib/philotic/version.rb
CHANGED