feat: integrate concurrent execution with useFeatureFlags pattern

Add CONCURRENT_EXECUTION_ENABLED and MAX_CONCURRENT_JOBS to
ServerFeatureFlag enum. Add reactive getters in useFeatureFlags with
proper cloud + auth gating (matching teamWorkspacesEnabled pattern).

Update useConcurrentExecution to consume flags from useFeatureFlags
instead of reading remoteConfig directly, enabling dev overrides and
consistent flag resolution.
This commit is contained in:
bymyself
2026-03-12 13:52:31 -07:00
parent 2664e5d629
commit 6c9f1fb4ca
2 changed files with 25 additions and 6 deletions

View File

@@ -1,13 +1,14 @@
import { computed } from 'vue'
import { remoteConfig } from '@/platform/remoteConfig/remoteConfig'
import { useFeatureFlags } from '@/composables/useFeatureFlags'
import { useSettingStore } from '@/platform/settings/settingStore'
export function useConcurrentExecution() {
const settingStore = useSettingStore()
const { flags } = useFeatureFlags()
const isFeatureEnabled = computed(
() => remoteConfig.value.concurrent_execution_enabled === true
() => flags.concurrentExecutionEnabled === true
)
const isUserEnabled = computed(
@@ -18,9 +19,7 @@ export function useConcurrentExecution() {
() => isFeatureEnabled.value && isUserEnabled.value
)
const maxConcurrentJobs = computed(
() => remoteConfig.value.max_concurrent_jobs ?? 1
)
const maxConcurrentJobs = computed(() => flags.maxConcurrentJobs as number)
const hasSeenOnboarding = computed(
() =>

View File

@@ -26,7 +26,9 @@ export enum ServerFeatureFlag {
NODE_LIBRARY_ESSENTIALS_ENABLED = 'node_library_essentials_enabled',
WORKFLOW_SHARING_ENABLED = 'workflow_sharing_enabled',
COMFYHUB_UPLOAD_ENABLED = 'comfyhub_upload_enabled',
COMFYHUB_PROFILE_GATE_ENABLED = 'comfyhub_profile_gate_enabled'
COMFYHUB_PROFILE_GATE_ENABLED = 'comfyhub_profile_gate_enabled',
CONCURRENT_EXECUTION_ENABLED = 'concurrent_execution_enabled',
MAX_CONCURRENT_JOBS = 'max_concurrent_jobs'
}
/**
@@ -156,6 +158,24 @@ export function useFeatureFlags() {
remoteConfig.value.comfyhub_profile_gate_enabled,
false
)
},
get concurrentExecutionEnabled() {
if (!isCloud) return false
if (!isAuthenticatedConfigLoaded.value) return false
return (
remoteConfig.value.concurrent_execution_enabled ??
api.getServerFeature(
ServerFeatureFlag.CONCURRENT_EXECUTION_ENABLED,
false
)
)
},
get maxConcurrentJobs() {
return (
remoteConfig.value.max_concurrent_jobs ??
api.getServerFeature(ServerFeatureFlag.MAX_CONCURRENT_JOBS, 1)
)
}
})