"CreateShadowentry" and "ProfileUpdate" now moved as well

This commit is contained in:
Michael 2017-11-19 16:59:37 +00:00
parent 98686e9091
commit 2de457489f
10 changed files with 46 additions and 37 deletions

View File

@ -3873,7 +3873,7 @@ function api_account_update_profile_image($type)
Worker::add(PRIORITY_LOW, "Directory", $url);
}
Worker::add(PRIORITY_LOW, 'profile_update', api_user());
Worker::add(PRIORITY_LOW, 'ProfileUpdate', api_user());
// output for client
if ($data) {

View File

@ -1,19 +0,0 @@
<?php
/**
* @file include/create_shadowentry.php
* @brief This script creates posts with UID = 0 for a given public post.
*
* This script is started from mod/item.php to save some time when doing a post.
*/
require_once("include/threads.php");
function create_shadowentry_run($argv, $argc) {
if ($argc != 2) {
return;
}
$message_id = intval($argv[1]);
add_shadow_entry($message_id);
}

View File

@ -1,12 +0,0 @@
<?php
use Friendica\Protocol\Diaspora;
function profile_update_run(&$argv, &$argc) {
if ($argc != 2) {
return;
}
$uid = intval($argv[1]);
Diaspora::send_profile($uid);
}

View File

@ -1064,7 +1064,7 @@ function item_post(App $a) {
// We now do it in the background to save some time.
// This is important in interactive environments like the frontend or the API.
// We don't fork a new process since this is done anyway with the following command
Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "create_shadowentry", $post_id);
Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowentry", $post_id);
// Call the background process that is delivering the item to the receivers
Worker::add(PRIORITY_HIGH, "notifier", $notify_type, $post_id);

View File

@ -135,7 +135,7 @@ function profile_photo_post(App $a) {
Worker::add(PRIORITY_LOW, "Directory", $url);
}
Worker::add(PRIORITY_LOW, 'profile_update', local_user());
Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
} else {
notice( t('Unable to process image') . EOL);
}

View File

@ -506,7 +506,7 @@ function profiles_post(App $a) {
Worker::add(PRIORITY_LOW, "Directory", $url);
}
Worker::add(PRIORITY_LOW, 'profile_update', local_user());
Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
// Update the global contact for the user
GlobalContact::updateForUser(local_user());

View File

@ -651,7 +651,7 @@ function settings_post(App $a) {
}
}
Worker::add(PRIORITY_LOW, 'profile_update', local_user());
Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
// Update the global contact for the user
GlobalContact::updateForUser(local_user());

View File

@ -923,7 +923,7 @@ class Worker {
*
* next args are passed as $cmd command line
* or: Worker::add(PRIORITY_HIGH, "notifier", "drop", $drop_id);
* or: Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "create_shadowentry", $post_id);
* or: Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowentry", $post_id);
*
* @note $cmd and string args are surrounded with ""
*

View File

@ -0,0 +1,21 @@
<?php
/**
* @file src/Worker/CreateShadowentry.php
* @brief This script creates posts with UID = 0 for a given public post.
*
* This script is started from mod/item.php to save some time when doing a post.
*/
namespace Friendica\Worker;
require_once("include/threads.php");
class CreateShadowentry {
public static function execute($message_id = 0) {
if (empty($message_id)) {
return;
}
add_shadow_entry($message_id);
}
}

View File

@ -0,0 +1,19 @@
<?php
/**
* @file src/Worker/ProfileUpdate.php
* @brief Send updated profile data to Diaspora
*/
namespace Friendica\Worker;
use Friendica\Protocol\Diaspora;
class ProfileUpdate {
public static function execute($uid = 0) {
if (empty($uid)) {
return;
}
Diaspora::send_profile($uid);
}
}