Merge pull request #9671 from annando/insert-ignore
Avoid "Duplicate entry"
This commit is contained in:
commit
b72f6d05cd
|
@ -22,6 +22,7 @@
|
||||||
namespace Friendica\Util;
|
namespace Friendica\Util;
|
||||||
|
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Database\Database;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\APContact;
|
use Friendica\Model\APContact;
|
||||||
|
@ -323,7 +324,7 @@ class HTTPSignature
|
||||||
|
|
||||||
$status = DBA::selectFirst('inbox-status', [], ['url' => $url]);
|
$status = DBA::selectFirst('inbox-status', [], ['url' => $url]);
|
||||||
if (!DBA::isResult($status)) {
|
if (!DBA::isResult($status)) {
|
||||||
DBA::insert('inbox-status', ['url' => $url, 'created' => $now, 'shared' => $shared]);
|
DBA::insert('inbox-status', ['url' => $url, 'created' => $now, 'shared' => $shared], Database::INSERT_IGNORE);
|
||||||
$status = DBA::selectFirst('inbox-status', [], ['url' => $url]);
|
$status = DBA::selectFirst('inbox-status', [], ['url' => $url]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue