Skip to content

Commit b4bb678

Browse files
authored
Remove check between worker_types and max_cached_workflows (#1063)
* Remove check to decrease breaks * remove test for this check
1 parent e0f86d7 commit b4bb678

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

crates/common/src/worker.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -317,17 +317,6 @@ impl WorkerConfigBuilder {
317317
return Err("`max_outstanding_nexus_tasks` must be > 0".to_owned());
318318
}
319319

320-
// Validate workflow cache is consistent with task_types
321-
if !task_types.enable_workflows
322-
&& let Some(cache) = self.max_cached_workflows.as_ref()
323-
&& *cache > 0
324-
{
325-
return Err(
326-
"Cannot have `max_cached_workflows` > 0 when workflows are not enabled in `task_types`"
327-
.to_owned(),
328-
);
329-
}
330-
331320
if let Some(cache) = self.max_cached_workflows.as_ref()
332321
&& *cache > 0
333322
{

crates/common/tests/worker_task_types_test.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,6 @@ fn test_empty_task_types_fails_validation() {
4949
);
5050
}
5151

52-
#[test]
53-
fn test_workflow_cache_without_workflows_fails() {
54-
let result = WorkerConfigBuilder::default()
55-
.namespace("default")
56-
.task_queue("test-queue")
57-
.versioning_strategy(default_versioning_strategy())
58-
.task_types(WorkerTaskTypes::activity_only())
59-
.max_cached_workflows(10usize)
60-
.build();
61-
62-
assert!(
63-
result.is_err(),
64-
"Workflow cache > 0 without workflows should fail"
65-
);
66-
let err = result.err().unwrap().to_string();
67-
assert!(
68-
err.contains("max_cached_workflows"),
69-
"Error should mention max_cached_workflows: {err}",
70-
);
71-
}
72-
7352
#[test]
7453
fn test_all_combinations() {
7554
let combinations = [

0 commit comments

Comments
 (0)