Merge branch '4.0'

This commit is contained in:
Ghostkeeper 2019-02-27 11:47:47 +01:00
commit 1c6cce316a
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
46 changed files with 149 additions and 169 deletions

View file

@ -108,7 +108,7 @@ class AuthorizationService:
# We have a fallback on a date far in the past for currently stored auth data in cura.cfg.
received_at = datetime.strptime(self._auth_data.received_at, TOKEN_TIMESTAMP_FORMAT) \
if self._auth_data.received_at else datetime(2000, 1, 1)
expiry_date = received_at + timedelta(seconds = float(self._auth_data.expires_in or 0))
expiry_date = received_at + timedelta(seconds = float(self._auth_data.expires_in or 0) - 60)
if datetime.now() > expiry_date:
self.refreshAccessToken()