Indefero

Indefero Commit Details


Date:2010-02-14 15:01:46 (15 years 2 months ago)
Author:Loic d'Anterroches
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:96e8f4ae3c48cabe422023577c7702308886b030
Parents: 355f9ca05f34756000004b7f25cd396f2ac44e39
Message:Added a better handling of simultaneous updates of the search index.

Changes:

File differences

src/IDF/Search.php
127127
128128
129129
130
131
132
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
133145
134146
135147
            if ($ids[$i] === null) {
                $word = new Pluf_Search_Word();
                $word->word = $words_flat[$i];
                $word->create();
                $ids[$i] = $word->id;
                $new_words++;
                try {
                    $word->create();
                    $new_words++;
                    $ids[$i] = $word->id;
                } catch (Exception $e) {
                    // 100% of the time, the word has been created
                    // by another process in the background.
                    $r_ids = self::getWordIds(array($word->word));
                    if ($r_ids[0]) {
                        $ids[$i] = $r_ids[0];
                    } else {
                        // give up for this word
                        continue;
                    }
                }
            }
            if (isset($done[$ids[$i]])) {
                continue;

Archive Download the corresponding diff file

Page rendered in 0.21784s using 13 queries.