bugfix
This commit is contained in:
parent
619399d250
commit
3aac52a2fe
@ -121,11 +121,8 @@ where b.orgid = c.ownerid
|
|||||||
i = randint(0, cnt - 1)
|
i = randint(0, cnt - 1)
|
||||||
return users[i].userid
|
return users[i].userid
|
||||||
|
|
||||||
async def get_api(self, appid, apiname):
|
async def get_api_from_db(self, appid, apiname):
|
||||||
key = f'{appid}.{apiname}'
|
key = f'{appid}.{apiname}'
|
||||||
api = self.apidata.get(key)
|
|
||||||
if api:
|
|
||||||
return api
|
|
||||||
env = ServerEnv()
|
env = ServerEnv()
|
||||||
async with get_sor_context(env, 'uapi') as sor:
|
async with get_sor_context(env, 'uapi') as sor:
|
||||||
d = await sor_get_uapi(sor, appid, apiname)
|
d = await sor_get_uapi(sor, appid, apiname)
|
||||||
@ -139,3 +136,10 @@ where b.orgid = c.ownerid
|
|||||||
exception(f'{e}')
|
exception(f'{e}')
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
async def get_api(self, appid, apiname):
|
||||||
|
key = f'{appid}.{apiname}'
|
||||||
|
api = self.apidata.get(key)
|
||||||
|
if api:
|
||||||
|
return api
|
||||||
|
return await self.get_api_from_db(appid, apiname)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user