souls 0.40.1 → 0.40.2
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 +22 -1
- 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: 830e9f1e9796eb865775399585c85ff3185a4896e43d815507db9b0a5774ab08
|
4
|
+
data.tar.gz: 41296eeb3bab8cb8e300625cf881f270cd526cbaf4f169eb74316e623910d8fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 998fdb38f2a8aa35557ab76a28992098e279ae8a2b8662348fe1b536389b7013302e544d583fdf75fd5d158c403c73e57b737d368806d8ece693e04855fe3d31
|
7
|
+
data.tar.gz: c646f6a1f8b6c558b4717ee1da213f9d613e5396523b56247bd545ff3d2510dc3620d71a6997523653c0fb3b6c3c364626db92ad27138999ab1d70df1d233617
|
@@ -23,7 +23,10 @@ module Souls
|
|
23
23
|
end
|
24
24
|
|
25
25
|
workers.each do |key, value|
|
26
|
-
|
26
|
+
if value == 1
|
27
|
+
create_topic(topic_id: key)
|
28
|
+
create_push_subscription(topic_id: key)
|
29
|
+
end
|
27
30
|
delete_topic(topic_id: key) if value == -1
|
28
31
|
end
|
29
32
|
workers
|
@@ -42,6 +45,24 @@ module Souls
|
|
42
45
|
puts("Topic #{topic_id} deleted.")
|
43
46
|
end
|
44
47
|
|
48
|
+
def create_push_subscription(topic_id: "mailer")
|
49
|
+
require("#{Souls.get_mother_path}/config/souls")
|
50
|
+
worker_name = topic_id.split("_")[0]
|
51
|
+
|
52
|
+
subscription_id = "#{topic_id}-sub"
|
53
|
+
endpoint = ""
|
54
|
+
worker_paths = Souls.configuration.workers
|
55
|
+
worker_paths.each do |worker|
|
56
|
+
endpoint = worker[:endpoint] if worker[:name] == worker_name
|
57
|
+
end
|
58
|
+
|
59
|
+
pubsub = Google::Cloud::Pubsub.new
|
60
|
+
|
61
|
+
topic = pubsub.topic(topic_id)
|
62
|
+
topic.subscribe(subscription_id, endpoint: endpoint)
|
63
|
+
puts("Push subscription #{subscription_id} created.")
|
64
|
+
end
|
65
|
+
|
45
66
|
def get_workers
|
46
67
|
require("#{Souls.get_mother_path}/config/souls")
|
47
68
|
worker_paths = Souls.configuration.workers.map { |n| n[:name] }
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.19.
|
1
|
+
0.19.2
|
@@ -1 +1 @@
|
|
1
|
-
0.19.
|
1
|
+
0.19.2
|