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) {
123123 if (workflow != null ) {
124124 // Delete the existing workflow if the cache has expired
125125 if (cacheExpired (workflow )) {
126- // Update by trying to add a new workflow
126+ removeWorkflow (workflow );
127+
128+ // Add the new workflow if it exists
127129 Workflow newWorkflow = createWorkflow (workflow .getRetrievedFrom ());
128130
129- // Only replace workflow if it could be successfully parsed
130131 if (newWorkflow == null ) {
132+ // Add back the old workflow if it is broken now
131133 logger .error ("Could not parse updated workflow " + workflow .getID ());
134+ workflowRepository .save (workflow );
132135 } else {
133- // Delete the existing workflow
134- removeWorkflow (workflow );
135-
136- // Save new workflow
137- workflowRepository .save (newWorkflow );
138136 workflow = newWorkflow ;
139137 }
140138 }
You can’t perform that action at this time.
0 commit comments