Ignore:
Timestamp:
Oct 23, 2007, 2:08:48 AM (17 years ago)
Author:
rvelices
Message:
  • update last_check from time to time even if no news, so that we don't delete used feeds
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/feed.php

    r1900 r2151  
    118118// +-----------------------------------------------------------------------+
    119119
     120$news = array();
    120121if (!$image_only)
    121122{
     
    152153  }
    153154}
    154 else
    155 {
    156   if ( !empty($feed_id) )
    157   {// update the last check to avoid deletion by maintenance task
     155
     156if ( !empty($feed_id) and empty($news) )
     157{// update the last check from time to time to avoid deletion by maintenance tasks
     158  if ( !isset($feed_row['last_check'])
     159    or time()-mysqldt_to_ts($feed_row['last_check']) > 30*24*3600 )
     160  {
    158161    $query = '
    159   UPDATE '.USER_FEED_TABLE.'
    160     SET last_check = \''.$dbnow.'\'
    161     WHERE id = \''.$feed_id.'\'
    162   ;';
     162UPDATE '.USER_FEED_TABLE.'
     163  SET last_check = DATE_ADD(\''.$dbnow.'\', INTERVAL -15 DAY )
     164  WHERE id = \''.$feed_id.'\'
     165;';
    163166    pwg_query($query);
    164167  }
Note: See TracChangeset for help on using the changeset viewer.