This action will:
- call the expired method that will extract all expired and elegible classifieds
- for each of them, trigger the expired event
( the mailer module will will bind this event with mailsend )
508535
public function expiredAction() 
	{
		$classifiedService = $this->getServiceLocator()->get('document.service.classified');
		
		try {
			$ids = $classifiedService->expired(3);
			$data = array(
				'status' => 'success',
				'message' => implode(", ", $ids)
			);
		} catch(\Exception $e) {
			$this->getResponse()
				->setStatusCode(Response::STATUS_CODE_500);
			$data = array(
				'status' => 'danger',
				'message' => $e->getMessage()
			);
		}

//         $viewModel = new ViewModel();
//         $viewModel->setTemplate('neobazaar/index/index');
//         return $viewModel;
		return new JsonModel($data);
	}
478583
@Override
    public final void expirerStart() throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "expirerStart");

        _expirer.start(_expiryInterval, _messagingEngine);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "expirerStart");
    }
594346
private void pruneExpiredTasks() {
        int numberExpiredTasksPruned = pruneHeadTasks(new Predicate<ReceiveQueueBuffer.ReceiveMessageBatchTask>() {
            @Override
            public boolean test(ReceiveMessageBatchTask t) {
                return t.isExpired() && t.getException() == null;
            }
        });
        // If we pruned any tasks because they are expired we also want to prune any empty tasks
        // afterwards so we have a chance to receive those expired messages again.
        if (numberExpiredTasksPruned > 0) {
            pruneHeadTasks(new Predicate<ReceiveQueueBuffer.ReceiveMessageBatchTask>() {
                @Override
                public boolean test(ReceiveMessageBatchTask t) {
                    return t.isEmpty() && t.getException() == null;
                }
            });
        }
    }
565115
def check_for_expired_workers
      return unless @socket
      loop do
        IO.select([@socket], nil, nil, 0) or return
        line = @socket.readline
        finish_worker(line.to_i, nil)
      end
    rescue EOFError, Errno::ECONNRESET => e
      @socket = nil
      log "#{e.class.name} while reading from master"
      Process.kill(:QUIT, $$)
    end
618438
def _extract_sender(
    message: Message, resent_dates: List[Union[str, Header]] = None
) -> str:
    
    if resent_dates:
        sender_header = "Resent-Sender"
        from_header = "Resent-From"
    else:
        sender_header = "Sender"
        from_header = "From"

    # Prefer the sender field per RFC 2822:3.6.2.
    if sender_header in message:
        sender = message[sender_header]
    else:
        sender = message[from_header]

    return str(sender) if sender else ""
215825
def _expired(self):
        
        LOG.info('Negotiated hold time %s expired.', self._holdtime)
        code = BGP_ERROR_HOLD_TIMER_EXPIRED
        subcode = BGP_ERROR_SUB_HOLD_TIMER_EXPIRED
        self.send_notification(code, subcode)
        self.connection_lost('Negotiated hold time %s expired.' %
                             self._holdtime)
        self.stop()
264990
function(){
    // Don't bother if there's no expires token
    if (typeof(service.token.expires_at) === 'undefined' || service.token.expires_at === null) {
      return;
    }
    cancelExpiresAtEvent();
    var time = (new Date(service.token.expires_at))-(new Date());
    if(time && time > 0 && time <= 2147483647){
      expiresAtEvent = $interval(function(){
        $rootScope.$broadcast('oauth:expired', service.token);
      }, time, 1);
    }
  }
1020014
protected function MapExpireDateFromAPI()
    {
        if (isset($this->aPaymentUserData['ED']) && '' !== $this->aPaymentUserData['ED']) {
            $this->aPaymentUserData['ECOM_CARDINFO_EXPDATE_MONTH'] = substr($this->aPaymentUserData['ED'], 0, 2);
            $this->aPaymentUserData['ECOM_CARDINFO_EXPDATE_YEAR'] = '20'.substr($this->aPaymentUserData['ED'], 2, 2);
        }
    }
713471
def expired(self):
    """"""
    expiry_time = self.expiry_time
    if expiry_time is not None:
      return expiry_time < rdfvalue.RDFDatetime.Now()
    else:
      return False
1169716
def delete_older(self):
        
        logger.info(
            "Deleting all mails strictly older than the {} timestamp..."
            "".format(self.newest_timestamp))
        # Select candidates for deletion.
        candidates = [
            mail for mail in self.pool
            if mail.timestamp < self.newest_timestamp]
        if len(candidates) == self.size:
            logger.warning(
                "Skip deletion: all {} mails share the same timestamp."
                "".format(self.size))
        logger.info(
            "{} candidates found for deletion.".format(len(candidates)))
        for mail in candidates:
            self.delete(mail)
1260551
def _has_expired(self):
        
        expired = False
        if hasattr(self, 'Expiration'):
            now = datetime.datetime.utcnow()
            expiration = datetime.datetime.strptime(self.Expiration, '%Y-%m-%dT%H:%M:%SZ')
            expired = (now >= expiration)
        else:
            raise ValueError("ERROR: Request for expired property, but no Expiration in HIT!")
        return expired
777130
def on_post_delete(sender, **kwargs):
    
    if not invalidate:
        return
    if kwargs.get("raw", False):
        return
    if sender is MigrationRecorder.Migration:
        return
    if issubclass(sender, Model):
        obj = kwargs["instance"]
        if isinstance(obj, Model):
            # get_for_model itself is cached
            try:
                ct = ContentType.objects.get_for_model(sender)
            except RuntimeError:
                # This happens when ultracache is being used by another product
                # during a test run.
                return

            # Expire cache keys
            key = "ucache-%s-%s" % (ct.id, obj.pk)
            to_delete = cache.get(key, [])
            if to_delete:
                try:
                    cache.delete_many(to_delete)
                except NotImplementedError:
                    for k in to_delete:
                        cache.delete(k)
            cache.delete(key)

            # Invalidate paths in reverse caching proxy
            key = "ucache-pth-%s-%s" % (ct.id, obj.pk)
            if purger is not None:
                for li in cache.get(key, []):
                    purger(li[0], li[1])
            cache.delete(key)
11854
private void ensureExpiration() {

        boolean expirationDateSet = false;
        boolean releaseDateSet = false;
        if (getFilterQueries() != null) {
            for (String fq : getFilterQueries()) {
                if (fq.startsWith(CmsSearchField.FIELD_DATE_EXPIRED + ":")) {
                    expirationDateSet = true;
                }
                if (fq.startsWith(CmsSearchField.FIELD_DATE_RELEASED + ":")) {
                    releaseDateSet = true;
                }
            }
        }
        if (!expirationDateSet) {
            addFilterQuery(CmsSearchField.FIELD_DATE_EXPIRED + ":[NOW TO *]");
        }
        if (!releaseDateSet) {
            addFilterQuery(CmsSearchField.FIELD_DATE_RELEASED + ":[* TO NOW]");
        }
    }
1029740
function delExpiredKeys(num, threshold) {

  function removeExpiredKeys(count) {
    if(!this._ekeys.length) return 0;
    var num = num || 100
      , threshold = threshold || 25
      , count = count || 0
      , i
      , key
      , ind;

    for(i = 0;i < num;i++) {
      ind = Math.floor(Math.random() * this._ekeys.length);
      key = this._ekeys[ind];
      if(this._expires[key] <= Date.now()) {
        this.emit('expired', key);
        this.delKey(key);
        count++;
      }
    }

    if(count >= threshold) {
      setImmediate(removeExpiredKeys);
    }

    return count;
  }

  removeExpiredKeys = removeExpiredKeys.bind(this);
  return removeExpiredKeys();
}
1047063
def expire_submission(submission_id, opts = {})
      data, _status_code, _headers = expire_submission_with_http_info(submission_id, opts)
      data
    end
101482
@Override
  public void run() {
    if (isTriggerExpired()) {
      logger.info(this + " expired");
      return;
    }

    final boolean isTriggerConditionMet = this.triggerCondition.isMet();
    if (isTriggerConditionMet) {
      logger.info("Condition " + this.triggerCondition.getExpression() + " met");
      for (final TriggerAction action : this.actions) {
        try {
          action.doAction();
        } catch (final Exception e) {
          logger.error("Failed to do action " + action.getDescription()
              + " for execution " + azkaban.execapp.Trigger.this.execId, e);
        }
      }
    }
  }
1115790
def expired(self):
        """"""
        self._data["_killed"] = True
        self.save()
        raise SessionExpired(self._config.expired_message)