@Extension @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final class Queue.Saver extends QueueListener implements Runnable
Queue.save()
call for near future once items change. Ignore all changes until the time the save
takes place.
Once queue is restored after a crash, items stages might not be accurate until the next #maintain() - this is not
a problem as the items will be reshuffled first and then scheduled during the next maintainance cycle.
Implementation note: Queue.load() calls QueueListener hooks for every item deserialized that can hammer the persistance
on load. The problem is avoided by delaying the actual save for the time long enough for queue to load so the save
operations will collapse into one. Also, items are persisted as buildable or blocked in vast majority of cases and
those stages does not trigger the save here.ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
Saver() |
Modifier and Type | Method and Description |
---|---|
void |
onEnterWaiting(Queue.WaitingItem wi)
When a task is submitted to the queue, it first gets to the waiting phase,
where it spends until the quiet period runs out and the item becomes executable.
|
void |
onLeft(Queue.LeftItem li)
The item has left the queue, either by getting
cancelled or by getting
picked up by an executor and starts running. |
void |
run() |
all, onEnterBlocked, onEnterBuildable, onLeaveBlocked, onLeaveBuildable, onLeaveWaiting
public void onEnterWaiting(Queue.WaitingItem wi)
QueueListener
onEnterWaiting
in class QueueListener
Queue.WaitingItem.timestamp
public void onLeft(Queue.LeftItem li)
QueueListener
cancelled
or by getting
picked up by an executor and starts running.onLeft
in class QueueListener
Copyright © 2004–2021. All rights reserved.