Plugin Directory

Changeset 1443535


Ignore:
Timestamp:
06/26/2016 06:42:32 AM (10 years ago)
Author:
drobertsorg
Message:

Fixed cache bug where retrieved date wasn't updating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-legisearch/trunk/os-client/WpJsonCacheable.class.php

    r1333351 r1443535  
    2929        $sql = "SELECT * FROM {$this->cacheTableName} WHERE url = '{$url}';";
    3030        $result = $wpdb->get_row( $sql );
    31         if( $wpdb->num_rows > 0 && strtotime( $result->retrieved ) >= strtotime( "- {$this->cacheTimeout} hours" ) ) {
     31
     32        if( $wpdb->num_rows > 0 && ( strtotime( $result->retrieved ) >= strtotime( "- {$this->cacheTimeout} hours" ) ) ) {
    3233            // Cache match and it's fresh
    3334            return $result->data;
     
    4445                array(      // data
    4546                    'url' => $url,
    46                     'data' => $json
     47                    'data' => $json,
     48                    'retrieved' => current_time( 'mysql' )
    4749                ),
    4850                array(      // where
     
    5254                    '%s',
    5355                    '%s',
     56                    '%s'
    5457                ),
    5558                array(      // where format
     
    6871                array(      // data
    6972                    'url' => $url,
    70                     'data' => $json
     73                    'data' => $json,
     74                    'retrieved' => current_time( 'mysql' )
    7175                ),
    7276                array(      // data format
    7377                    '%s',
    7478                    '%s',
     79                    '%s'
    7580                )
    7681            );
     
    8792    }
    8893}
     94
Note: See TracChangeset for help on using the changeset viewer.