Ignore:
Timestamp:
Sep 26, 2010, 8:15:35 PM (11 years ago)
Author:
teymour
Message:

Bug étrange avec les url_for dans les task
Gestion plus rationnelle du app.yml
Parametrage de l'envoi des alertes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/lib/task/sendAlertTask.class.php

    r1327 r1438  
    88    $this->name = 'Alert';
    99    $this->briefDescription = 'send alerts';
    10     $this->addOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'test');
     10    $this->addOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'prod');
    1111    $this->addOption('app', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'frontend');
    1212  }
     
    1717    $manager = new sfDatabaseManager($this->configuration);
    1818    $context = sfContext::createInstance($this->configuration);
    19     $this->configuration->loadHelpers('Partial');
     19    $this->configuration->loadHelpers(array('Partial', 'Url'));
    2020   
    2121    $solr = new SolrConnector();
    2222    $query = Doctrine::getTable('Alerte')->createQuery('a')->where('next_mail < NOW()');
    2323    foreach($query->execute() as $alerte) {
    24       $date = strtotime(preg_replace('/ /', 'T', $alerte->last_mail)."Z")+1-3600;
    25       $query = $alerte->query." date:[".date('Y-m-d', $date).'T'.date('H:i:s', $date)."Z TO NOW]";
     24      $date = strtotime(preg_replace('/ /', 'T', $alerte->last_mail)."Z")-3600*2;
     25      $query = $alerte->query." date:[".date('Y-m-d', $date).'T'.date('H:i:s', $date)."Z TO ".date('Y-m-d').'T'.date('H:i:s')."Z]";
    2626      $results = $solr->search($query, array('sort' => 'date desc', 'hl' => 'yes', 'hl.fragsize'=>500));
    2727      echo "$query\n";
Note: See TracChangeset for help on using the changeset viewer.