diff options
author | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-05-31 07:36:25 +0200 |
---|---|---|
committer | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-05-31 07:36:25 +0200 |
commit | 745d075397941e0a84d017342bb9c4c4a4c1ef5b (patch) | |
tree | 98c1e5e93952b281dbedb63c1fb2e18344153202 /include/items.php | |
parent | 087f79236e79975d482f739e84cc16f6648e1bec (diff) | |
parent | f95ea14478e256d7eb331385746f83532d78d84a (diff) | |
download | volse-hubzilla-745d075397941e0a84d017342bb9c4c4a4c1ef5b.tar.gz volse-hubzilla-745d075397941e0a84d017342bb9c4c4a4c1ef5b.tar.bz2 volse-hubzilla-745d075397941e0a84d017342bb9c4c4a4c1ef5b.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index cbf5e4d24..fbcac30cd 100644 --- a/include/items.php +++ b/include/items.php @@ -742,6 +742,15 @@ function item_store($arr,$force_parent = false) { $arr['uri'], // already dbesc'd intval($arr['uid']) ); + if(! count($r)) { + // This is not good, but perhaps we encountered a rare race/cache condition, so back off and try again. + sleep(3); + $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + $arr['uri'], // already dbesc'd + intval($arr['uid']) + ); + } + if(count($r)) { $current_post = $r[0]['id']; logger('item_store: created item ' . $current_post); |