@@ -9,6 +9,7 @@ use circus_common::{
99 CreateJobset ,
1010 Evaluation ,
1111 EvaluationStatus ,
12+ EvaluationTriggerKind ,
1213 JobsetInput ,
1314 JobsetState ,
1415 JobsetTriggerMode ,
@@ -103,7 +104,7 @@ async fn run_cycle(
103104 continue ;
104105 } ;
105106
106- if jobset. trigger_mode . accepts_source_triggers ( ) {
107+ if accepts_pending_evaluation ( jobset. trigger_mode , eval . trigger_kind ) {
107108 pending_jobset_ids. insert ( eval. jobset_id ) ;
108109 pending_tasks. push ( ( eval, jobset. clone ( ) ) ) ;
109110 } else {
@@ -221,6 +222,14 @@ async fn run_cycle(
221222 Ok ( ( ) )
222223}
223224
225+ fn accepts_pending_evaluation (
226+ trigger_mode : JobsetTriggerMode ,
227+ trigger_kind : EvaluationTriggerKind ,
228+ ) -> bool {
229+ trigger_mode. accepts_source_triggers ( )
230+ || trigger_kind == EvaluationTriggerKind :: Interval
231+ }
232+
224233fn warn_on_disk_pressure ( msg : & str ) {
225234 let lower = msg. to_lowercase ( ) ;
226235 if lower. contains ( "no space left on device" )
@@ -970,3 +979,22 @@ async fn discover_projects_without_jobsets(
970979 sync_repo_declarative_config ( pool, & repo_path, project. id ) . await ;
971980 }
972981}
982+
983+ #[ cfg( test) ]
984+ mod tests {
985+ use circus_common:: models:: { EvaluationTriggerKind , JobsetTriggerMode } ;
986+
987+ use super :: accepts_pending_evaluation;
988+
989+ #[ test]
990+ fn interval_restarts_are_accepted_by_pending_queue ( ) {
991+ assert ! ( accepts_pending_evaluation(
992+ JobsetTriggerMode :: Interval ,
993+ EvaluationTriggerKind :: Interval ,
994+ ) ) ;
995+ assert ! ( !accepts_pending_evaluation(
996+ JobsetTriggerMode :: Interval ,
997+ EvaluationTriggerKind :: Manual ,
998+ ) ) ;
999+ }
1000+ }
0 commit comments