souls 1.21.8 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d5989b972bb93949215156aac0d1d35110eeb998419ded0cf31c1b4872ef06a
4
- data.tar.gz: 5c81810f878ce4aabb7bc155ed1c4dfce05ca787ad47d45449440d3ca111b03b
3
+ metadata.gz: bf225b8fb6383d37d0557dc336cf837066f80b2f9053f6cbf5710e5664a48206
4
+ data.tar.gz: 74a2b152293eb1aa547756f6abc50ba3937f451fc895215ced1c1c97719d485f
5
5
  SHA512:
6
- metadata.gz: c8e76007b148e35453bff8d0d16309f3b50f39c8b307bb7bb17fc717ca4a74eba870b0d83b86800c73091516234996546d65ff4978a3739cb6b774b8d6df7e7c
7
- data.tar.gz: 14912f26822268f96d53a97e9fc916ddfc3c98501ac47044598fcf1f3158657f4e8f8a8d922ca76bcf8d632a412d575cae3ccd1f7dc5cc66fdb4d704c7377bc0
6
+ metadata.gz: b412b04e1a4d1bc5a286ea2329ab416a5a94dbd285e9f9047b077d0a056c70bf577c702c4c0f5a051dbbf8879f50b878c506779ab6bb894226bf43b9547759c0
7
+ data.tar.gz: 729ab0de6a94f82469b8df9103740d03e671d26ecc6b42db217a947e0445f550e0a59e1725494f5e274040219155e82f5d18be596164b2dc5671459741e31f68
@@ -28,11 +28,16 @@ module SOULs
28
28
  end
29
29
 
30
30
  def souls_fb_auth(token: "")
31
+ raise(ArgumentError, "Invalid or Missing Token") if token.blank?
32
+
31
33
  FirebaseIdToken::Certificates.request!
32
- sleep(3)
33
34
  user = FirebaseIdToken::Signature.verify(token)
34
- raise(ArgumentError, "Invalid or Missing Token") if user.blank?
35
-
35
+ if user.blank?
36
+ Retryable.retryable(tries: 20, on: ArgumentError) do
37
+ user = FirebaseIdToken::Signature.verify(token)
38
+ raise(ArgumentError, "Invalid or Missing Token") if user.blank?
39
+ end
40
+ end
36
41
  user
37
42
  end
38
43
 
@@ -3,7 +3,8 @@ module SOULs
3
3
  desc "awake [url]", "Set Ping by Google Cloud Scheduler: Cron e.g. '0 10 * * *' or 'every 10 hours'"
4
4
  def awake
5
5
  app_name = SOULs.configuration.app.gsub("_", "-")
6
- worker_names = SOULs.configuration.workers.map(&:name)
6
+ project_id = SOULs.configuration.project_id
7
+ worker_names = SOULs.configuration.workers.map { |f| f[:name] }
7
8
  services = ["souls-#{app_name}-api"]
8
9
  worker_names.each { |worker| services << "souls-#{app_name}-#{worker}" }
9
10
 
@@ -11,10 +12,10 @@ module SOULs
11
12
  service = prompt.select("Select Service?", services)
12
13
  cron = prompt.ask("Cron Schedule?", default: "every 10 mins")
13
14
 
14
- url = SOULs::GcloudRun.new.get_endpoint(service)
15
+ url = SOULs::CloudRun.new.get_endpoint(service)
15
16
  system(
16
17
  "gcloud scheduler jobs create http #{app_name}-awake \
17
- --schedule '#{cron}' --uri #{url} --http-method GET"
18
+ --schedule '#{cron}' --uri '#{url}' --project=#{project_id} --http-method GET"
18
19
  )
19
20
  end
20
21
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "1.21.8".freeze
2
+ VERSION = "1.22.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.21.8
1
+ 1.22.0
@@ -1 +1 @@
1
- 1.21.8
1
+ 1.22.0
data/lib/souls.rb CHANGED
@@ -9,6 +9,7 @@ require "whirly"
9
9
  require "tty-prompt"
10
10
  require "thor"
11
11
  require "resolv"
12
+ require "retryable"
12
13
  require "google/cloud/pubsub"
13
14
 
14
15
  module SOULs
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.8
4
+ version: 1.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-01-19 00:00:00.000000000 Z
13
+ date: 2022-02-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -138,6 +138,20 @@ dependencies:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: 2.8.3
141
+ - !ruby/object:Gem::Dependency
142
+ name: retryable
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: 3.0.5
148
+ type: :runtime
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: 3.0.5
141
155
  - !ruby/object:Gem::Dependency
142
156
  name: thor
143
157
  requirement: !ruby/object:Gem::Requirement