Another worker process moved
This commit is contained in:
parent
83861a01cc
commit
3687ef2f8c
3 changed files with 23 additions and 25 deletions
|
@ -68,7 +68,7 @@ function contact_remove($id) {
|
|||
dba::delete('contact', array('id' => $id));
|
||||
|
||||
// Delete the rest in the background
|
||||
Worker::add(PRIORITY_LOW, 'remove_contact', $id);
|
||||
Worker::add(PRIORITY_LOW, 'RemoveContact', $id);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @file include/remove_contact.php
|
||||
* @brief Removes orphaned data from deleted contacts
|
||||
*/
|
||||
|
||||
use Friendica\Core\Config;
|
||||
|
||||
function remove_contact_run($argv, $argc) {
|
||||
if ($argc != 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
$id = intval($argv[1]);
|
||||
|
||||
// Only delete if the contact doesn't exist (anymore)
|
||||
$r = dba::exists('contact', array('id' => $id));
|
||||
if ($r) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Now we delete all the depending table entries
|
||||
dba::delete('contact', array('id' => $id));
|
||||
}
|
22
src/Worker/RemoveContact.php
Normal file
22
src/Worker/RemoveContact.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
/**
|
||||
* @file src/Worker/RemoveContact.php
|
||||
* @brief Removes orphaned data from deleted contacts
|
||||
*/
|
||||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Core\Config;
|
||||
|
||||
class RemoveContact {
|
||||
public static function execute($id) {
|
||||
|
||||
// Only delete if the contact doesn't exist (anymore)
|
||||
$r = dba::exists('contact', array('id' => $id));
|
||||
if ($r) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Now we delete all the depending table entries
|
||||
dba::delete('contact', array('id' => $id));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue