Skip to content

Commit

Permalink
Json dump the data
Browse files Browse the repository at this point in the history
  • Loading branch information
trent-codecov committed Jun 2, 2023
1 parent fcf4b29 commit d2f321e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions shared/torngit/github.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
import hashlib
import logging
import os
import json
from base64 import b64decode
from typing import List

@@ -677,7 +678,7 @@ async def get_commit_statuses(self, commit, token=None):
loggable_token=self.loggable_token(token)
),
)
return Status(statuses)
return Status(json.loads(statuses))
statuses = []
async with self.get_client() as client:
while True:
@@ -710,7 +711,7 @@ async def get_commit_statuses(self, commit, token=None):
redis_service = self.get_redis_service()
redis_service.set(
cache_key,
statuses,
json.dumps(statuses),
self._status_cache_duration,
)
return Status(statuses)
@@ -779,7 +780,7 @@ async def get_compare(
loggable_token=self.loggable_token(token)
),
)
return result
return json.loads(result)
async with self.get_client() as client:
res = await self.api(
client,
@@ -838,7 +839,7 @@ async def get_compare(
redis_service = self.get_redis_service()
redis_service.set(
cache_key,
result,
json.dumps(result),
self._compare_cache_duration,
)
return result

0 comments on commit d2f321e

Please sign in to comment.