Package hudson.model

Class Queue.Saver

All Implemented Interfaces:
ExtensionPoint, Runnable
Enclosing class:
Queue

@Extension @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final class Queue.Saver extends QueueListener implements Runnable
Schedule 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.