File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/main/java/org/commonwl/view/workflow Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -123,18 +123,16 @@ public Workflow getWorkflow(GithubDetails githubInfo) {
123
123
if (workflow != null ) {
124
124
// Delete the existing workflow if the cache has expired
125
125
if (cacheExpired (workflow )) {
126
- // Update by trying to add a new workflow
126
+ removeWorkflow (workflow );
127
+
128
+ // Add the new workflow if it exists
127
129
Workflow newWorkflow = createWorkflow (workflow .getRetrievedFrom ());
128
130
129
- // Only replace workflow if it could be successfully parsed
130
131
if (newWorkflow == null ) {
132
+ // Add back the old workflow if it is broken now
131
133
logger .error ("Could not parse updated workflow " + workflow .getID ());
134
+ workflowRepository .save (workflow );
132
135
} else {
133
- // Delete the existing workflow
134
- removeWorkflow (workflow );
135
-
136
- // Save new workflow
137
- workflowRepository .save (newWorkflow );
138
136
workflow = newWorkflow ;
139
137
}
140
138
}
You can’t perform that action at this time.
0 commit comments