sandbox doesn't provide auto disable log (#12388)

This commit is contained in:
Jyong
2025-01-06 15:57:13 +08:00
committed by GitHub
parent 3b8f6233b0
commit 9c317b64c3
2 changed files with 6 additions and 17 deletions

View File

@@ -434,6 +434,12 @@ class DatasetService:
@staticmethod
def get_dataset_auto_disable_logs(dataset_id: str) -> dict:
features = FeatureService.get_features(current_user.current_tenant_id)
if not features.billing.enabled or features.billing.subscription.plan == "sandbox":
return {
"document_ids": [],
"count": 0,
}
# get recent 30 days auto disable logs
start_date = datetime.datetime.now() - datetime.timedelta(days=30)
dataset_auto_disable_logs = DatasetAutoDisableLog.query.filter(