Fix/shared lock (#210)

This commit is contained in:
John Wang
2023-05-25 21:31:11 +08:00
committed by GitHub
parent 4ef6392de5
commit 1a5acf43aa
3 changed files with 18 additions and 3 deletions

View File

@@ -171,7 +171,7 @@ class ConversationMessageTask:
)
if not by_stopped:
self._pub_handler.pub_end()
self.end()
def update_provider_quota(self):
llm_provider_service = LLMProviderService(
@@ -268,6 +268,9 @@ class ConversationMessageTask:
total_price = message_tokens_per_1k * message_unit_price + answer_tokens_per_1k * answer_unit_price
return total_price.quantize(decimal.Decimal('0.0000001'), rounding=decimal.ROUND_HALF_UP)
def end(self):
self._pub_handler.pub_end()
class PubHandler:
def __init__(self, user: Union[Account | EndUser], task_id: str,