[wp-trac] [WordPress Trac] #25047: Improve heartbeat queue checking

WordPress Trac noreply at wordpress.org
Tue Aug 20 22:33:32 UTC 2013


#25047: Improve heartbeat queue checking
--------------------------+-----------------------
 Reporter:  evansolomon   |       Owner:  azaozz
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  3.7
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------

Comment (by evansolomon):

 Replying to [comment:8 azaozz]:
 > `getQueuedItem()` can directly return `queue[ handle ]`, i.e. undefined
 if handle is not in queue.

 It should still check `isQueued()` first to avoid cases like
 `wp.heartbeat.isQueued('constructor')`.  For example:

 {{{
 this.getQueuedItem = function(item) {
   return this.isQueued(item) ? queue[item] : undefined;
 }
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25047#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list