selfsdk 0.0.139 → 0.0.140

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +20 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd7dee3974b09378a7893e93df82bf77a9e082dfcc386b61dc5def8660276233
4
- data.tar.gz: b2cc3bec34b678a941cb13ca7f46e82851a7b29ef2f5a4c0a6d5047dfb0aa73d
3
+ metadata.gz: 031a8f44592664c22d59c7c1105822ab9111dde46ffda50ba34b6116d70d4a3f
4
+ data.tar.gz: e2096831cb8f8d5bcba45fabf93a5173fac96f06ec933b6f6d446d1ed55f015a
5
5
  SHA512:
6
- metadata.gz: 603796714f57dae9c509dd5d8bfdae2a9433f41d6bdeb653e55ec8e0aeb6c3b953799fac5651f21e83f3a9526c276e84bd55b655a489074765e13baf21924764
7
- data.tar.gz: 3e8b669f3449d9e2335e113fbc638795fc42ac2ef3b5463f14d560460a1bd6ff5d542e453e8b8702ef19454038fcc53f95205e5f21e63965428238b4662bc9d6
6
+ metadata.gz: 368a7cdacf1df7204473e6488e299e06e40b6caacc332c366ca039fea96930186e4888e007a333e99a6693d9b6ae18d13b4ae339f7d2cd988a1c412826bfce47
7
+ data.tar.gz: bc484da9425cc8e9f3b4d7e7af132f15395b1966109636e941ff3b5592ace7d914b65f338de4287de96e8d1d92dac03d5555667f1e146311a4965975b3154888
@@ -66,19 +66,31 @@ module SelfSDK
66
66
  end
67
67
 
68
68
  def post(endpoint, body)
69
- p HTTParty.post("#{@self_url}#{endpoint}",
70
- headers: {
71
- 'Content-Type' => 'application/json',
72
- 'Authorization' => "Bearer #{@jwt.auth_token}"
73
- },
74
- body: body)
69
+ res = nil
70
+ loop do
71
+ res = HTTParty.post("#{@self_url}#{endpoint}",
72
+ headers: {
73
+ 'Content-Type' => 'application/json',
74
+ 'Authorization' => "Bearer #{@jwt.auth_token}"
75
+ },
76
+ body: body)
77
+ break if res.code != 503
78
+ sleep 2
79
+ end
80
+ return res
75
81
  end
76
82
 
77
83
  def get(endpoint)
78
- HTTParty.get("#{@self_url}#{endpoint}", headers: {
84
+ res = nil
85
+ loop do
86
+ res = HTTParty.get("#{@self_url}#{endpoint}", headers: {
79
87
  'Content-Type' => 'application/json',
80
88
  'Authorization' => "Bearer #{@jwt.auth_token}"
81
- })
89
+ })
90
+ break if res.code != 503
91
+ sleep 2
92
+ end
93
+ return res
82
94
  end
83
95
 
84
96
  # Lists all public keys stored on self for the given ID
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfsdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.139
4
+ version: 0.0.140
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldgate Ventures