mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 14:38:06 +08:00
feat(trigger): enhance trigger subscription management and cache handling
- Added `name` parameter to `TriggerSubscriptionBuilderCreateApi` for better subscription identification. - Implemented `delete_cache_for_subscription` function to clear cache associated with trigger subscriptions. - Updated `WorkflowPluginTriggerService` to check for existing subscriptions before creating new plugin triggers, improving error handling. - Refactored `TriggerProviderService` to utilize the new cache deletion method during provider deletion. This improves the overall management of trigger subscriptions and enhances cache efficiency.
This commit is contained in:
@ -65,6 +65,13 @@ def create_trigger_provider_encrypter_for_subscription(
|
||||
)
|
||||
return encrypter, cache
|
||||
|
||||
def delete_cache_for_subscription(tenant_id: str, provider_id: str, subscription_id: str):
|
||||
cache = TriggerProviderCredentialsCache(
|
||||
tenant_id=tenant_id,
|
||||
provider_id=provider_id,
|
||||
credential_id=subscription_id,
|
||||
)
|
||||
cache.delete()
|
||||
|
||||
def create_trigger_provider_encrypter_for_properties(
|
||||
tenant_id: str,
|
||||
|
||||
Reference in New Issue
Block a user