mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 02:43:49 +08:00
fix(api): resolve new agent beta task typing
This commit is contained in:
parent
a13d201184
commit
0f37c8b1e0
@ -118,15 +118,14 @@ def register_new_agent_beta_workflow_publish_after_commit(
|
||||
reject_on_worker_lost=True,
|
||||
)
|
||||
def ensure_new_agent_beta_participation_task(self, source_id: str, source_type: str = "revision") -> None:
|
||||
if source_type == "revision":
|
||||
ensure = BillingService.ensure_new_agent_beta_revision
|
||||
elif source_type == "workflow":
|
||||
ensure = BillingService.ensure_new_agent_beta_workflow
|
||||
else:
|
||||
if source_type not in {"revision", "workflow"}:
|
||||
raise ValueError(f"Unsupported New Agent Beta source type: {source_type}")
|
||||
|
||||
try:
|
||||
ensure(source_id)
|
||||
if source_type == "revision":
|
||||
BillingService.ensure_new_agent_beta_revision(source_id)
|
||||
else:
|
||||
BillingService.ensure_new_agent_beta_workflow(source_id)
|
||||
except Exception as exc:
|
||||
if self.request.retries >= _MAX_RETRIES:
|
||||
logger.exception(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user