We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 650074c6 authored by Evan Prodromou's avatar Evan Prodromou

don't insert the same notice twice into an inbox

parent d3f99584
......@@ -114,6 +114,16 @@ class Inbox extends Memcached_DataObject
return false;
}
$ids = unpack('N*', $inbox->notice_ids);
// bulk inserts sometimes fail and get restarted.
// Skip if this one has been inserted before.
if (in_array($notice_id, $ids)) {
// effectively successful
return true;
}
$result = $inbox->query(sprintf('UPDATE inbox '.
'set notice_ids = concat(cast(0x%08x as binary(4)), '.
'substr(notice_ids, 1, %d)) '.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment