Skip to content

Commit

Permalink
fix(cli): restore-queue try to send invalid flow to queue
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Feb 8, 2022
1 parent 0b31a59 commit 06896b8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.kestra.cli.services;

import io.kestra.core.models.flows.Flow;
import io.kestra.core.models.flows.FlowSource;
import io.kestra.core.models.templates.Template;
import io.kestra.core.models.triggers.Trigger;
import io.kestra.core.queues.QueueFactoryInterface;
Expand Down Expand Up @@ -32,6 +33,8 @@ public int flows(boolean noRecreate) {
.findAll()
.stream()
.flatMap(flow -> flowRepository.findRevisions(flow.getNamespace(), flow.getId()).stream())
// we can't resend FlowSource since deserialize failed & will be invalid
.filter(flow -> !(flow instanceof FlowSource))
.collect(Collectors.toList());

return this.send(flows, QueueFactoryInterface.FLOW_NAMED, Flow.class, noRecreate);
Expand Down

0 comments on commit 06896b8

Please sign in to comment.