huginn_strava_agent 0.1.0 → 0.1.10
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/huginn_strava_agent/strava_agent.rb +9 -8
- 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: e2806334223a93f535eec627c84537b3d30affacf91ade6df381380d3c33eda2
|
4
|
+
data.tar.gz: 55cb8e7042f5661eaf3b5f98b4f4f69e2a757973f12c031a608abb4e21c4042b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fb6f5d192013b1e4732c1ac02ed0a210cf727c4d60dd283ab9abbf25d546135fa75629fb142aad6dc78e4386ba07c36883a10d8aef81ac06204c51f7e7d02a8
|
7
|
+
data.tar.gz: feb7d03492de0d0be57a8ab675b302b6ea70088e5861b9ee847b05614666191bc4bad8fe6ca7ef6f7fa4b4cb9c0ff0187490d1ae158eb807e2ddfe7570828eb6
|
@@ -200,16 +200,17 @@ module Agents
|
|
200
200
|
|
201
201
|
def check_token_validity()
|
202
202
|
|
203
|
-
|
204
|
-
|
205
|
-
current_timestamp = Time.now.to_i
|
206
|
-
|
207
|
-
difference_in_hours = (timestamp_to_compare - current_timestamp) / 3600.0
|
208
|
-
|
209
|
-
if difference_in_hours < 2
|
203
|
+
if memory['expires_at'].nil?
|
210
204
|
token_refresh()
|
211
205
|
else
|
212
|
-
|
206
|
+
timestamp_to_compare = memory['expires_at']
|
207
|
+
current_timestamp = Time.now.to_i
|
208
|
+
difference_in_hours = (timestamp_to_compare - current_timestamp) / 3600.0
|
209
|
+
if difference_in_hours < 2
|
210
|
+
token_refresh()
|
211
|
+
else
|
212
|
+
log "refresh not needed"
|
213
|
+
end
|
213
214
|
end
|
214
215
|
|
215
216
|
end
|