Skip to content

Commit 9dcf53a

Browse files
authored
Fix broken Matrix builds (#107)
1 parent a272d86 commit 9dcf53a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/java/hudson/plugins/build_timeout/global/GlobalTimeOutConfiguration.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ public Optional<Duration> timeOutFor(AbstractBuild<?,?> build, BuildListener lis
101101
return Optional.empty();
102102
}
103103
return Optional.of(Duration.ofMillis(strategy.getTimeOut(build, listener)));
104-
// } catch (ClassCastException e) {
104+
} catch (ClassCastException e) {
105105
// log.log(WARNING, e, () -> String.format("%s cannot allow individual jobs to overwrite timeout due to ClassCastException", build.getExternalizableId()));
106-
// if (strategy == null) {
107-
// return Optional.empty();
108-
// }
109-
// try {
110-
// return Optional.of(Duration.ofMillis(strategy.getTimeOut(build, listener)));
111-
// } catch (InterruptedException | MacroEvaluationException | IOException ex) {
112-
// log.log(WARNING, ex, () -> String.format("%s failed to determine time out", build.getExternalizableId()));
113-
// return Optional.empty();
114-
// }
106+
if (strategy == null) {
107+
return Optional.empty();
108+
}
109+
try {
110+
return Optional.of(Duration.ofMillis(strategy.getTimeOut(build, listener)));
111+
} catch (InterruptedException | MacroEvaluationException | IOException ex) {
112+
log.log(WARNING, ex, () -> String.format("%s failed to determine time out", build.getExternalizableId()));
113+
return Optional.empty();
114+
}
115115
} catch (InterruptedException | MacroEvaluationException | IOException e) {
116116
log.log(WARNING, e, () -> String.format("%s failed to determine time out", build.getExternalizableId()));
117117
return Optional.empty();

0 commit comments

Comments
 (0)