jwt_auth_token 1.4.1 → 1.4.2
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/common_helper.rb +14 -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: b1655b57d5e8a2f06704731b8f4b7c315f7dc46b
|
4
|
+
data.tar.gz: cdbd710aeda51b54970d3384178c0fd585c4507c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0590b8f3a1f638abbba3c6ea3521d24782581919bdee3b08bfe9e3ef08b5d7cc8c5cc082d3fbca12069d703a7a71403ad70894f30bf1b531b213edb20e9bb0a2'
|
7
|
+
data.tar.gz: 5258ec49a2643195eb4ce0ad6af59a955ee6f2cb0d5b862ee192f254765ff9721bf84a6248c862e3709c0d9541c9227996fbbe2aa158aa786c7acfcb9c3fa9e6
|
data/lib/common_helper.rb
CHANGED
@@ -36,7 +36,20 @@ module CommonHelper
|
|
36
36
|
def redis_push(custom_log_data)
|
37
37
|
topic_name = "#{current_micro_service_name}-log-#{Rails.env}"
|
38
38
|
redis_format_data = {class: "KafkaMicroServicesLogs", args: [custom_log_data, topic_name], retry: true, queue: "logs", jid: SecureRandom.hex(12), created_at: Time.zone.now.to_i, enqueued_at: Time.zone.now.to_i}
|
39
|
-
redis_log.lpush(
|
39
|
+
redis_log.lpush(redis_queue_name, redis_format_data.to_json)
|
40
|
+
end
|
41
|
+
|
42
|
+
def kafka_db_log_to_same_topic
|
43
|
+
custom_log_data = self.as_json
|
44
|
+
db_name = self.class.name.split("::").map(&:downcase).join("-")
|
45
|
+
topic_name = "#{db_name}-db-#{Rails.env}"
|
46
|
+
redis_format_data = {class: "TestAppDbKafkaLogWorker", args: [custom_log_data, topic_name], retry: true, queue: "logs", jid: SecureRandom.hex(12), created_at: Time.zone.now.to_i, enqueued_at: Time.zone.now.to_i}
|
47
|
+
redis_log.lpush(redis_queue_name, redis_format_data.to_json)
|
48
|
+
end
|
49
|
+
|
50
|
+
def redis_queue_name
|
51
|
+
return "queue:logs" if Rails.env.production?
|
52
|
+
return "test-app:queue:logs"
|
40
53
|
end
|
41
54
|
|
42
55
|
def user_agent_meta_log
|