Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions crates/common/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,6 @@ impl WorkerConfigBuilder {
return Err("`max_outstanding_nexus_tasks` must be > 0".to_owned());
}

// Validate workflow cache is consistent with task_types
if !task_types.enable_workflows
&& let Some(cache) = self.max_cached_workflows.as_ref()
&& *cache > 0
{
return Err(
"Cannot have `max_cached_workflows` > 0 when workflows are not enabled in `task_types`"
.to_owned(),
);
}

if let Some(cache) = self.max_cached_workflows.as_ref()
&& *cache > 0
{
Expand Down
21 changes: 0 additions & 21 deletions crates/common/tests/worker_task_types_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,6 @@ fn test_empty_task_types_fails_validation() {
);
}

#[test]
fn test_workflow_cache_without_workflows_fails() {
let result = WorkerConfigBuilder::default()
.namespace("default")
.task_queue("test-queue")
.versioning_strategy(default_versioning_strategy())
.task_types(WorkerTaskTypes::activity_only())
.max_cached_workflows(10usize)
.build();

assert!(
result.is_err(),
"Workflow cache > 0 without workflows should fail"
);
let err = result.err().unwrap().to_string();
assert!(
err.contains("max_cached_workflows"),
"Error should mention max_cached_workflows: {err}",
);
}

#[test]
fn test_all_combinations() {
let combinations = [
Expand Down
Loading