getKey()); } public static function existForTenantId(?int $tenantId): bool { if (! is_int($tenantId) || $tenantId <= 0) { return false; } return OperationRun::query() ->where('tenant_id', $tenantId) ->healthyActive() ->exists(); } public static function pollingIntervalForTenant(?Tenant $tenant): ?string { return $tenant instanceof Tenant ? self::pollingIntervalForTenantId((int) $tenant->getKey()) : null; } public static function pollingIntervalForTenantId(?int $tenantId): ?string { return self::existForTenantId($tenantId) ? '10s' : null; } }