bugfix
This commit is contained in:
parent
21df5fdc80
commit
d5b1d934c1
@ -34,7 +34,7 @@ async def get_tpac_balance(apikey, userid):
|
|||||||
url = config.tpac.get_user_balance_url
|
url = config.tpac.get_user_balance_url
|
||||||
hc = StreamHttpClient()
|
hc = StreamHttpClient()
|
||||||
try:
|
try:
|
||||||
b = hc.request('GET', url, params={"apikey": apikey, 'userid': userid})
|
b = await hc.request('GET', url, params={"apikey": apikey, 'userid': userid})
|
||||||
if b:
|
if b:
|
||||||
d = json.loads(b.decode('utf-8'))
|
d = json.loads(b.decode('utf-8'))
|
||||||
if d['status'] == 'ok':
|
if d['status'] == 'ok':
|
||||||
@ -60,7 +60,7 @@ async def tpac_accounting(apikey, userid, llmid, amount, usage):
|
|||||||
hc = StreamHttpClient()
|
hc = StreamHttpClient()
|
||||||
status = 'failed'
|
status = 'failed'
|
||||||
try:
|
try:
|
||||||
b = hc.request('POST', url, data=d)
|
b = await hc.request('POST', url, data=d)
|
||||||
d = json.loads(b.decode('utf-8'))
|
d = json.loads(b.decode('utf-8'))
|
||||||
if d['status'] == 'ok':
|
if d['status'] == 'ok':
|
||||||
status = 'accounted'
|
status = 'accounted'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user