Ignore:
Timestamp:
Dec 16, 2011, 2:52:40 PM (9 years ago)
Author:
plg
Message:

bug 2534 fixed: clean (as clean as possible with MySQL+MyISAM) handle of
concurrency on user cache refresh. No more error when regenerating several
thumbnails at once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/include/functions_user.inc.php

    r12339 r12747  
    447447      pwg_query($query);
    448448
     449      // Due to concurrency issues, we ask MySQL to ignore errors on
     450      // insert. This may happen when cache needs refresh and that Piwigo is
     451      // called "very simultaneously".
    449452      mass_inserts
    450453      (
     
    455458          'date_last', 'max_date_last', 'nb_images', 'count_images', 'count_categories'
    456459        ),
    457         $user_cache_cats
     460        $user_cache_cats,
     461        array('ignore' => true)
    458462      );
    459463
     
    465469      pwg_query($query);
    466470
     471      // for the same reason as user_cache_categories, we ignore error on
     472      // this insert
    467473      $query = '
    468 INSERT INTO '.USER_CACHE_TABLE.'
     474INSERT IGNORE INTO '.USER_CACHE_TABLE.'
    469475  (user_id, need_update, cache_update_time, forbidden_categories, nb_total_images,
    470476    image_access_type, image_access_list)
Note: See TracChangeset for help on using the changeset viewer.