diff --git a/product_management/core.py b/product_management/core.py index ade732b..73938fb 100644 --- a/product_management/core.py +++ b/product_management/core.py @@ -1529,7 +1529,9 @@ WHERE resource_ref_id = ${llm_id}$ AND product_type = 'llm_model' LIMIT 1""" await consume_accounting(sor, orderid, accounting_items) # Mark llmusage as accounted - async with db.sqlorContext('llmage') as sor: + from ahserver.serverenv import ServerEnv + lmage_dbname = ServerEnv().get_module_dbname('llmage') + async with db.sqlorContext(lmage_dbname) as sor: await sor.U('llmusage', { 'id': llmusage.id, 'accounting_status': 'accounted' @@ -1565,7 +1567,9 @@ WHERE resource_ref_id = ${llm_id}$ AND product_type = 'llm_model' LIMIT 1""" await self.product_accounting(lu) # Clean up failed records try: - async with DBPools().sqlorContext('llmage') as sor: + from ahserver.serverenv import ServerEnv + lmage_dbname = ServerEnv().get_module_dbname('llmage') + async with DBPools().sqlorContext(lmage_dbname) as sor: await sor.execute( "DELETE FROM llmusage_accounting_failed WHERE llmusageid=${luid}$", {'luid': lu.id})