souls 0.68.0 → 0.68.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/souls/cli/sync/pubsub.rb +14 -23
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f0ecf3c4d7ed19f71c77c666d6a04136607799edf909212cb5a36f7cc4a0d43
|
4
|
+
data.tar.gz: d139a13a4bfa5017e0a359308abfdeb61ead755548c43264ce34d83c901d6442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6343d5e59243629addafc281c618c9e3191c909096937525a90710be443315f1a672730b44e67cfc9d4252a1b173e4125a223c233466e52afa44f57bfd73620d
|
7
|
+
data.tar.gz: fdc1b3ad6fb2a74c957c18e927a045d9d63418e9e979040ba86b5d79d6f46e406feee139816113e0ebbef7b7485bd07259a90bc55b6db050a5bec86d8c89494d
|
@@ -12,9 +12,8 @@ module Souls
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def get_topics(workers: {})
|
15
|
-
app_name = Souls.configuration.app
|
16
15
|
project_id = Souls.configuration.project_id
|
17
|
-
pubsub = Google::Cloud::Pubsub.new(project_id:
|
16
|
+
pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
|
18
17
|
topics = pubsub.topics
|
19
18
|
|
20
19
|
topic_names =
|
@@ -22,7 +21,7 @@ module Souls
|
|
22
21
|
topic.name.gsub("projects/#{project_id}/topics/", "")
|
23
22
|
end
|
24
23
|
|
25
|
-
souls_topics = topic_names.select { |n| n.include?("souls_
|
24
|
+
souls_topics = topic_names.select { |n| n.include?("souls_") }
|
26
25
|
|
27
26
|
souls_topics.each do |name|
|
28
27
|
value = workers[name.to_sym] || 0
|
@@ -40,17 +39,16 @@ module Souls
|
|
40
39
|
end
|
41
40
|
|
42
41
|
def create_topic(topic_id: "mailer")
|
43
|
-
|
44
|
-
pubsub = Google::Cloud::Pubsub.new(project_id:
|
45
|
-
|
46
|
-
topic = pubsub.create_topic(topic_name.to_s)
|
42
|
+
project_id = Souls.configuration.project_id
|
43
|
+
pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
|
44
|
+
topic = pubsub.create_topic(topic_id.to_s)
|
47
45
|
puts("Topic #{topic.name} created.")
|
48
46
|
end
|
49
47
|
|
50
48
|
def delete_topic(topic_id: "mailer")
|
51
|
-
|
52
|
-
pubsub = Google::Cloud::Pubsub.new(project_id:
|
53
|
-
topic_name = "
|
49
|
+
project_id = Souls.configuration.project_id
|
50
|
+
pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
|
51
|
+
topic_name = "#{topic_id}_sub"
|
54
52
|
topic = pubsub.topic(topic_name.to_s)
|
55
53
|
topic.delete
|
56
54
|
puts("Topic #{topic_name} deleted.")
|
@@ -58,18 +56,17 @@ module Souls
|
|
58
56
|
|
59
57
|
def create_push_subscription(topic_id: "mailer")
|
60
58
|
require("#{Souls.get_mother_path}/config/souls")
|
61
|
-
|
62
|
-
topic_name = "souls_#{app_name}_#{topic_id}"
|
63
|
-
worker_name = topic_id.split("_")[0]
|
59
|
+
worker_name = topic_id.split("_")[1]
|
64
60
|
|
65
|
-
subscription_id = "#{
|
61
|
+
subscription_id = "#{topic_id}_sub"
|
66
62
|
endpoint = ""
|
67
63
|
worker_paths = Souls.configuration.workers
|
68
64
|
worker_paths.each do |worker|
|
69
65
|
endpoint = worker[:endpoint] if worker[:name] == worker_name
|
70
66
|
end
|
71
67
|
|
72
|
-
|
68
|
+
project_id = Souls.configuration.project_id
|
69
|
+
pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
|
73
70
|
|
74
71
|
topic = pubsub.topic(topic_name)
|
75
72
|
sub = topic.subscribe(subscription_id, endpoint: endpoint, deadline: 20)
|
@@ -83,19 +80,13 @@ module Souls
|
|
83
80
|
response = {}
|
84
81
|
Dir.chdir(Souls.get_mother_path.to_s) do
|
85
82
|
worker_paths.each do |worker|
|
86
|
-
mailers =
|
87
|
-
Dir["apps/#{worker}/app/graphql/mutations/mailers/*.rb"].map do |file|
|
88
|
-
file.gsub("apps/#{worker}/app/graphql/mutations/mailers/", "").gsub(".rb", "")
|
89
|
-
end
|
90
|
-
|
91
83
|
workers =
|
92
84
|
Dir["apps/#{worker}/app/graphql/mutations/*.rb"].map do |file|
|
93
85
|
file.gsub("apps/#{worker}/app/graphql/mutations/", "").gsub(".rb", "")
|
94
86
|
end
|
95
87
|
workers.delete("base_mutation")
|
96
|
-
|
97
|
-
|
98
|
-
response[:"#{worker}_#{file}"] = 1
|
88
|
+
workers.each do |file|
|
89
|
+
response[:"souls_#{worker}_#{file}"] = 1
|
99
90
|
end
|
100
91
|
end
|
101
92
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.47.
|
1
|
+
0.47.1
|
@@ -1 +1 @@
|
|
1
|
-
0.47.
|
1
|
+
0.47.1
|