mirror of
https://github.com/langgenius/dify.git
synced 2026-11-12 06:11:12 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
17 lines
715 B
Python
17 lines
715 B
Python
from celery import shared_task
|
|
|
|
from configs import dify_config
|
|
from extensions.ext_application_services import application_services
|
|
from libs.helper import current_timestamp
|
|
|
|
|
|
@shared_task(queue="trigger_refresh_publisher")
|
|
def trigger_provider_refresh() -> None:
|
|
"""Scan due subscriptions in bounded batches and enqueue independently reserved jobs."""
|
|
application_services().triggers.subscription_refresh.enqueue_due(
|
|
now=current_timestamp(),
|
|
credential_threshold=dify_config.TRIGGER_PROVIDER_CREDENTIAL_THRESHOLD_SECONDS,
|
|
subscription_threshold=dify_config.TRIGGER_PROVIDER_SUBSCRIPTION_THRESHOLD_SECONDS,
|
|
batch_size=dify_config.TRIGGER_PROVIDER_REFRESH_BATCH_SIZE,
|
|
)
|