Skip to content

Commit

Permalink
Warn in Queue.init if items scheduled during startup will be clobbe…
Browse files Browse the repository at this point in the history
…red (#5934)
  • Loading branch information
jglick authored Nov 23, 2021
1 parent 55c31c8 commit e3ebd48
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/hudson/model/Queue.java
Original file line number Diff line number Diff line change
Expand Up @@ -3103,7 +3103,12 @@ public static Queue getInstance() {
*/
@Initializer(after=JOB_CONFIG_ADAPTED)
public static void init(Jenkins h) {
h.getQueue().load();
Queue queue = h.getQueue();
Item[] items = queue.getItems();
if (items.length > 0) {
LOGGER.warning(() -> "Loading queue will discard previously scheduled items: " + Arrays.toString(items));
}
queue.load();
}

/**
Expand Down

0 comments on commit e3ebd48

Please sign in to comment.