mirror of
https://github.com/friendica/friendica
synced 2025-04-21 09:50:11 +00:00
The priority is now a class constant
This commit is contained in:
parent
b33b70f0ab
commit
018858934b
46 changed files with 148 additions and 151 deletions
|
@ -59,7 +59,7 @@ class Contact extends BaseAdmin
|
|||
|
||||
if ($block_purge) {
|
||||
foreach (Model\Contact::selectToArray(['id'], ['nurl' => $contact['nurl']]) as $contact) {
|
||||
Worker::add(PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
|
||||
Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ class Add extends BaseAdmin
|
|||
if (!empty($request['purge'])) {
|
||||
$gservers = GServer::listByDomainPattern($pattern);
|
||||
foreach (Contact::selectToArray(['id'], ['gsid' => array_column($gservers, 'id')]) as $contact) {
|
||||
Worker::add(PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
|
||||
Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
|
||||
}
|
||||
|
||||
$this->sysmsg->addInfo($this->l10n->tt('%s server scheduled to be purged.', '%s servers scheduled to be purged.', count($gservers)));
|
||||
|
|
|
@ -53,7 +53,7 @@ class Site extends BaseAdmin
|
|||
$a = DI::app();
|
||||
|
||||
if (!empty($_POST['republish_directory'])) {
|
||||
Worker::add(PRIORITY_LOW, 'Directory');
|
||||
Worker::add(Worker::PRIORITY_LOW, 'Directory');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ class Site extends BaseAdmin
|
|||
// Has the directory url changed? If yes, then resubmit the existing profiles there
|
||||
if ($global_directory != DI::config()->get('system', 'directory') && ($global_directory != '')) {
|
||||
DI::config()->set('system', 'directory', $global_directory);
|
||||
Worker::add(PRIORITY_LOW, 'Directory');
|
||||
Worker::add(Worker::PRIORITY_LOW, 'Directory');
|
||||
}
|
||||
|
||||
if (DI::baseUrl()->getUrlPath() != "") {
|
||||
|
|
|
@ -104,7 +104,7 @@ class Create extends BaseApi
|
|||
$item = ['network' => Protocol::DFRN, 'protocol' => Conversation::PARCEL_DIRECT, 'direction' => Conversation::PUSH];
|
||||
$item = Event::getItemArrayForId($event_id, $item);
|
||||
if (Item::insert($item)) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$item['uri-id'], $uid);
|
||||
Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$item['uri-id'], $uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ use Friendica\App\Router;
|
|||
use Friendica\Content\Text\Markdown;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -204,7 +205,7 @@ class Statuses extends BaseApi
|
|||
if (!empty($request['scheduled_at'])) {
|
||||
$item['guid'] = Item::guid($item, true);
|
||||
$item['uri'] = Item::newURI($item['guid']);
|
||||
$id = Post\Delayed::add($item['uri'], $item, PRIORITY_HIGH, Post\Delayed::PREPARED, $request['scheduled_at']);
|
||||
$id = Post\Delayed::add($item['uri'], $item, Worker::PRIORITY_HIGH, Post\Delayed::PREPARED, $request['scheduled_at']);
|
||||
if (empty($id)) {
|
||||
DI::mstdnError()->InternalError();
|
||||
}
|
||||
|
|
|
@ -126,9 +126,9 @@ class Contact extends BaseModule
|
|||
}
|
||||
|
||||
// pull feed and consume it, which should subscribe to the hub.
|
||||
Worker::add(PRIORITY_HIGH, 'OnePoll', $contact_id, 'force');
|
||||
Worker::add(Worker::PRIORITY_HIGH, 'OnePoll', $contact_id, 'force');
|
||||
} else {
|
||||
Worker::add(PRIORITY_HIGH, 'UpdateContact', $contact_id);
|
||||
Worker::add(Worker::PRIORITY_HIGH, 'UpdateContact', $contact_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ class FriendSuggest extends BaseModule
|
|||
$note
|
||||
));
|
||||
|
||||
Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id);
|
||||
Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id);
|
||||
|
||||
info($this->t('Friend suggestion sent.'));
|
||||
}
|
||||
|
|
|
@ -338,7 +338,7 @@ class Photo extends BaseModule
|
|||
}
|
||||
if ($update) {
|
||||
Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
|
||||
Worker::add(PRIORITY_LOW, 'UpdateContact', $id);
|
||||
Worker::add(Worker::PRIORITY_LOW, 'UpdateContact', $id);
|
||||
} else {
|
||||
Logger::info('Invalid file', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
|
||||
}
|
||||
|
|
|
@ -302,7 +302,7 @@ class Register extends BaseModule
|
|||
|
||||
if ($netpublish && intval(DI::config()->get('config', 'register_policy')) !== self::APPROVE) {
|
||||
$url = $base_url . '/profile/' . $user['nickname'];
|
||||
Worker::add(PRIORITY_LOW, 'Directory', $url);
|
||||
Worker::add(Worker::PRIORITY_LOW, 'Directory', $url);
|
||||
}
|
||||
|
||||
if ($additional_account) {
|
||||
|
|
|
@ -375,7 +375,7 @@ class Account extends BaseSettings
|
|||
// "http" or "@" to be present in the string.
|
||||
// All other fields from the row will be ignored
|
||||
if ((strpos($csvRow[0], '@') !== false) || Network::isValidHttpUrl($csvRow[0])) {
|
||||
Worker::add(PRIORITY_MEDIUM, 'AddContact', local_user(), $csvRow[0]);
|
||||
Worker::add(Worker::PRIORITY_MEDIUM, 'AddContact', local_user(), $csvRow[0]);
|
||||
} else {
|
||||
Logger::notice('Invalid account', ['url' => $csvRow[0]]);
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ class Account extends BaseSettings
|
|||
}
|
||||
|
||||
if (!empty($request['relocate-submit'])) {
|
||||
Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
|
||||
Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
|
||||
info(DI::l10n()->t("Relocate message has been send to your contacts"));
|
||||
DI::baseUrl()->redirect($redirectUrl);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue