This hopefully fixes the strange "token expired" errors we get that seem
to auto recover after 30 minutes.
def bsjwt(self):
if 'accessjwt' in self.providerconfig:
# If the access token expires within 30 minutes, refresh it!
- if datetime.fromtimestamp(self.providerconfig['accesstokenexpires']) < datetime.utcnow() + timedelta(minutes=30):
+ if datetime.utcfromtimestamp(self.providerconfig['accesstokenexpires']) < datetime.utcnow() + timedelta(minutes=30):
r = requests.post(
'https://bsky.social/xrpc/com.atproto.server.refreshSession',
headers={'Authorization': 'Bearer {}'.format(self.providerconfig['refreshjwt'])},