Skip to content

Commit f2f80be

Browse files
fix jenkins job in error during popcorn redeployment
1 parent f6f95a2 commit f2f80be

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<!-- More Project Information -->
3636
<name>Lectra Popcorn Plugin</name>
3737
<description>This plugin allows integration of Popcorn</description>
38-
<inceptionYear>2022</inceptionYear>
38+
<inceptionYear>2023</inceptionYear>
3939

4040
<organization>
4141
<name>LECTRA</name>

src/main/java/com/lectra/ci/service/StatusService.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package com.lectra.ci.service;
1717

1818
import com.lectra.ci.domain.model.Metrics;
19-
import hudson.model.Computer;
19+
import hudson.model.Job;
2020
import jenkins.model.Jenkins;
2121

2222
/** Status service gather and expose information on the system. */
@@ -63,9 +63,10 @@ private int computeQueueSize() {
6363
*/
6464
private int computeRunningJobs() {
6565
int cpt = 0;
66-
Computer[] computers = jenkinsInstance.getComputers();
67-
for (Computer computer : computers) {
68-
cpt += computer.countBusy();
66+
for (Job job : jenkinsInstance.getAllItems(Job.class)) {
67+
if ( job.isBuilding() ) {
68+
cpt++;
69+
}
6970
}
7071
return cpt;
7172
}

0 commit comments

Comments
 (0)