/** * Need to override this method for facebook, since they use oauth2 * */ protected function send($pPostBody) { $this->onlineIdentity->scheduleImportJob(); Queue\Queue::getInstance()->put(new Documents\InterestImportJob($this->onlineIdentity->getId())); $lToken = $this->getAuthToken(); $pPostBody .= "&access_token=" . $lToken->getTokenKey(); return UrlUtils::sendPostRequest(sfConfig::get("app_" . $this->classToIdentifier() . "_post_api"), $pPostBody); }
public function executeWork(sfWebRequest $request) { $queue = Queue\Queue::getInstance(); while ($job = $queue->get()) { try { $job->execute(); $job->finished(); } catch (Exception $e) { $job->reschedule($e->getMessage()); } } return $this->redirect('job/index'); }
public function scheduleImportJob() { if (!$this->getLastFriendRefresh() || $this->getLastFriendRefresh() < strtotime(sfConfig::get("app_jobs_last_friend_refresh_threshold"))) { Queue\Queue::getInstance()->put(new Documents\ContactImportJob($this->getId())); } }
<?php /** * a batch file to send an email if a deal is expired * * @author Matthias Pfefferle */ require_once dirname(__FILE__) . '/../../config/BatchConfiguration.class.php'; require_once dirname(__FILE__) . '/../../config/ProjectConfiguration.class.php'; $configuration = \ProjectConfiguration::getApplicationConfiguration('statistics', BatchConfiguration::ENV, true); \sfContext::createInstance($configuration); // get job $job = Queue\Queue::getInstance()->get(); if ($job) { try { // try to execute job $job->execute(); $job->finished(); } catch (\Exception $e) { $job->reschedule($e->getMessage()); } }